You are on page 1of 17

2019-06

Algebra of Random Arrays

Hugo Hernandez
ForsChem Research, 050030 Medellin, Colombia
hugo.hernandez@forschem.org

doi: 10.13140/RG.2.2.28607.15520

Abstract

Arrays of random variables are possible mathematical constructions. While typically the
analysis of random variables assume that they are scalars, it is possible to generalize such
analysis to arrays of random variables. For that purpose, it is important to consider that
products and powers or random arrays must be performed using the element-wise Hadamard
operations. Thus, the probability density function, expected value, variance and any other
moment of a random array should be expressed as an array with the same dimensions of the
original random variable. Particularly for vectors, additional variables can be determined such
as the norm or magnitude of the vector and its direction angles. An example is presented
where the norm and direction angles of the three-dimensional uniform random position of a
particle in a square box are determined. The algebra of random arrays is also used to describe
the behavior of complex random variables when they are represented as two dimensional
vectors in the complex plane. Some caution is required in this case, as the dimensions of the
complex plane are not truly orthogonal when the Hadamard product is used.

Keywords

Arrays, Complex random variables, Expected value, Hadamard product, Matrices, Probability
density functions, Pseudovariance, Random variables, Randomistics, Tensors, Variance, Vectors

1. Introduction

Typically, conventional statistical theory rarely considers arrays of random variables, as random
variables are mainly considered as scalars.[1] However, it is possible to construct arrays of
random variables leading to random vectors (unidimensional arrays), random matrices
(bidimensional arrays), and random tensors (higher-dimensional arrays). The purpose of this

04/06/2019 ForsChem Research Reports 2019-06 (1 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

report is summarizing the most relevant aspects of the algebra of mathematical arrays of
continuous random variables.§ Two particular cases are considered in detail: properties of
three-dimensional random vectors, and the algebra of complex random variables (when
considered as vectors).

Let us first define a -th dimensional random array as follows:

{ }
(1.1)

where indicates the position of the element in the -th dimension, indicates the total
number of elements in the -th dimension, and is a scalar random variable located at
the position { } in the array. Random variables located at different positions of the
array do not need to be independent from each other. Bold variables indicate arrays, and the
brackets { } indicate the position of a particular element in the array.

2. Algebra of Random Arrays

2.1. Probability Density Function of Random Arrays

First of all, since each element of the array is represented by a scalar random variable
with a particular probability density function , the probability distribution of the
random array can be represented by the probability density array:

( ){ } ( )
(2.1)
where represents a particular realization of the random scalar .

For example, let us consider the position of a particle in a three-dimensional box of size ,
whose center is at the center of Cartesian coordinates. The position vector of the particle will
correspond to the following array of scalar random variables:

[ ]

(2.2)

§
Analogue results for discrete random variables are possible.

04/06/2019 ForsChem Research Reports 2019-06 (2 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

where represents the position vector, and the random position of the particle in the -th
axis. Assuming a uniform distribution of the position of the particle in each direction, the
probability density of the position vector for any particle inside the box ( ) will be:

[ ] [ ] [ ]

(2.3)

2.2. Expected Value of Random Arrays

Extending the definition of the expected value to arrays of random variables we have:

( ) ∫ ( )

(2.4)

where ( ) is the expected value of the array , which is also an array; represents an array of
realizations of ; the operator represents the Hadamard or Schur product (elementwise
product**)[1]; and the limits of the integral are arrays of positive or negative infinite values with
the same dimensions of . Using Eq. (1.1) and Eq. (2.1) it is possible to transform Eq. (2.4) into:

( ){ } ∫ { } ( ){ } { }

∫ ( ) ( )

( { })
(2.5)

Thus, the expected value of a random array is the array of expected values of the individual
elements in the random array.

For the previous example of a particle position uniformly distributed in a square box, the
expected value of the position vector is:

**
Please notice that the Hadamard product requires that all factors have the same dimensions. Then, the
result will preserve the dimensions of the factors.

04/06/2019 ForsChem Research Reports 2019-06 (3 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

( )
( ) [ ( )] [ ]
( )
(2.6)

2.3. Moments of Random Arrays

Eq. (2.4) can be generalized for the determination of the -th raw moment of the random
array,[2] considering the Hadamard power as follows:

( ) ( ) ∫ ( )

(2.7)

where represents the Hadamard (elementwise) power of .

2.4. Variance of Random Arrays

A particular application of the previous definition of the moments of an array is the variance of
random arrays. In general, the variance is defined as the second central moment of a random
variable, thus:

( ) (( ( )) ) ∫ ( ( )) ( ) ( ) ( ( ))

(2.8)

Furthermore, the standard deviation of the array is:

( ) ( ( ))
(2.9)

Considering the example of the particle in a square box of side ,

( ( ))
(2.10)
Thus,

04/06/2019 ForsChem Research Reports 2019-06 (4 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

( ) ( ) ∫ ( ) ∫ |

[ ]
(2.11)
and

( ) ( )

(2.12)

3. Properties of Random Vectors

Particularly for unidimensional arrays of random variables, or random vectors, it is possible to


analyze additional properties such as the Euclidean norm and the direction (angles) of the
vector.

3.1. Euclidean Norm of Random Vectors

The Euclidean norm of a vector of length is defined as:

‖ ‖ √ √∑( { }) √∑

(3.1)
where ‖ ‖ represents the vector norm††, and represents the dot product operator.

In order to analyze the squared norm of the vector, let us describe it by the random variable :

‖ ‖ ∑

(3.2)
The expected value of the squared norm is:

The operator notation | | for vector norms was not used in order to avoid confusion with the absolute
††

value operator.

04/06/2019 ForsChem Research Reports 2019-06 (5 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

( ) (‖ ‖ ) ∑ ( ) ∑ ( ) ∑( ( ))

(3.3)
and the variance of the squared norm is:

( ) (‖ ‖ ) ∑ ( ) ∑ ( ) ∑( ( ))

(3.4)

The probability density function of the squared norm can be obtained by applying the change
of variable theorem [3] from Eq. (3.2):

( ) ∫ ∫ ∫ ( √ ∑ )

( √ ∑ ) ∏( ( ) )
√ ∑
( )
)
(3.5)

On the other hand, the behavior of the norm of the random vector is (now defining as the
norm of the vector):

( ) (‖ ‖) (√∑ )

(3.6)

( ) (‖ ‖) (√∑ )

(3.7)

No further simplification is possible if the probability density function of the norm is unknown.

The corresponding probability density function of the norm can be obtained as:

04/06/2019 ForsChem Research Reports 2019-06 (6 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

( ) ∫ ∫ ∫ ( √ ∑ )

( √ ∑ ) ∏( ( ) )
√ ∑
( )
)
(3.8)

Considering the particle position uniformly distributed in a square box of size , the expected
value and variance of the squared norm will be:

(‖ ‖ )
(3.9)

(‖ ‖ )
(3.10)

since ( ) ∫ .‡‡

On the other hand, in order to determine the expected value and variance of the norm, its
probability density function must be obtained first (from Eq. 3.8). For three dimensions we get:

( )

∫ ∫


∫ ∫ ( √ )

∫ ∫

√ √

√ √
√ √

√ √
{ ( ) ( ) ( ) ( )
( )
(3.11)

‡‡
See [4] for additional results on uniform random variables.

04/06/2019 ForsChem Research Reports 2019-06 (7 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

This probability density function is presented graphically in Figure 1.

Figure 1. Probability density function of the norm ( ) of the three-dimensional position vector
of a uniform random particle in a square box of size .

Thus, the expected value of the norm of the three-dimensional position vector for a particle
uniformly distributed in a square box whose center is the origin of coordinates is:

√ √ √ √
(‖ ‖) ∫ ( ) [ ( √ ) ( )]

(3.12)

(‖ ‖) (‖ ‖ ) ( (‖ ‖)) ( )
(3.13)

Please notice that in general:

(‖ ‖) √ (‖ ‖ ) ‖ ( )‖
(3.14)
And similarly,

(‖ ‖) √ (‖ ‖ ) ‖ ( )‖
(3.15)
(‖ ‖) √ (‖ ‖ ) ‖ ( )‖
(3.16)

04/06/2019 ForsChem Research Reports 2019-06 (8 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

3.2. Direction of Random Vectors

Let us now consider the direction of the three-dimensional random position vector, as depicted
in Figure 2. In this case, and represent the polar and azimuthal angles respectively, in a
spherical coordinate system.

Figure 2. Spherical coordinate system representing the direction of a three-dimensional vector.

The azimuthal angle for this system can be expressed as:

( )

(3.17)
and the polar angle is given by:

( )
(3.18)

Given that these expressions are nonlinear, the expected value and variance of the angles must
be determined from their corresponding probability density functions:

| |
∫ | |
( ) ( )

| |
( ) ∫
( ) ( )

| |

( ) ( )
{
(3.19)

04/06/2019 ForsChem Research Reports 2019-06 (9 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

√ (√ )
∫ ∫ √ | |
( ) ( )

( √ ( ) )

( ) ∫ ∫ ( ) | |

( )

√ ( )
| |
∫ ∫ √ | |
( ) ( )
{
(3.20)

where

| |
( ) √( ) (| | √( ) ) √( ) (( ) ) ( )
( ) √( )
(

√( ) | |
| | ( ( ) (√( ) ))
√( ) | |
( √( ) ))
(3.21)

The probability density functions for the azimuthal and the polar angles are presented in Figure
3 and Figure 4, respectively.

The expected value and variance of the azimuthal angle are:

( )
(3.22)
( )
(3.23)

and for the polar angle:


( )
(3.24)
( )
(3.25)

04/06/2019 ForsChem Research Reports 2019-06 (10 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

Figure 3. Probability density function of the azimuthal angle ( ) of the three-dimensional


position vector of a uniform random particle in a square box of size .

Figure 4. Probability density function of the polar angle ( ) of the three-dimensional position
vector of a uniform random particle in a square box of size .

Please notice that these results are only valid when the random components of the vector are
identical uniform probability distributions. Otherwise, the probability distribution of the
azimuthal and polar angles will be different and must be obtained for each particular case.

04/06/2019 ForsChem Research Reports 2019-06 (11 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

3.3. Random Vectors represented by Orthogonal Unit Vectors

Vectors can also be expressed as linear functions of their corresponding orthogonal unit
vectors. For example, for three-dimensional vectors, three different orthogonal unit vectors
can be defined:

̂ [ ]

̂ [ ]

̂ [ ]

(3.26)
The Hadamard product for these unit vectors results in the following properties:

̂ ̂ ̂
(3.27)

̂ ̂ [ ]

(3.28)

Furthermore, the expected value and variance of a unit vector will be:

(̂ ) ̂
(3.29)

(̂ ) (̂ ̂) (̂ ) (̂ ) (̂ ) ̂ [ ]

(3.30)

Now, a random vector can also be described as the linear combination of different scalar
random variables, one for each orthogonal direction:

̂ ̂ ̂
(3.31)
Therefore, the expected value and variance of the random vector are:

( )
( ) ( ̂ ) ( ̂ ) ( ̂ ) ( )̂ ( )̂ ( )̂ [ ( )]
( )
(3.32)

04/06/2019 ForsChem Research Reports 2019-06 (12 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

( ) (( ̂ ̂ ̂ ) ( ̂ ̂ ̂ )) ( ) ( )
( ̂ ̂ ) ( ̂ ̂ ) ( ̂ ̂ ) ( ̂ ̂ )
( ̂ ̂ ) ( ̂ ̂ ) ( )̂ ̂ ( )̂ ̂
( )̂ ̂
( )̂ ( )̂ ( )̂ ( )̂ ( )̂ ( )̂
( )
( )̂ ( )̂ ( )̂ [ ( )]
( )
(3.33)

which are consistent with the results presented in Section 2.

4. Algebra of Complex Random Variables

A particular and interesting case of application of the algebra of random variables is for
complex random variables. Complex random variables are linear combinations of two real
scalar random variables, one assigned to the real domain and the other to the imaginary
domain. Traditionally, complex variables have been geometrically represented in a two-
dimensional Cartesian plane,[5] also known as the Argand diagram.[6] According to this
geometrical representation, a two-dimensional vector representation of complex variables has
been used. According to this vector representation, the complex number is represented
by the vector [ ], where the first element represents the real domain with unit direction vector

̂ [ ]. Similarly, the second element represents the imaginary domain, with unit direction

vector ̂ [ ].

Using this notation, a complex random variable can be represented as the complex
random vector:
[ ]
(4.1)
where and are real scalar random variables.

Thus, according to the algebra of random arrays presented in Section 2, the expected value,
variance and standard deviation of the random vector should be:

( )
( ) [ ]
( )
(4.2)

04/06/2019 ForsChem Research Reports 2019-06 (13 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

( )
( ) [ ]
( )
(4.3)
√ ( )
( ) [ ]
√ ( )
(4.4)

Care must be taken when transforming these results back into the complex domain. For the
expected value, the transformation is straightforward:

( ) ( ) ( )
(4.5)

However, the variance and the standard deviation cannot be transformed back into the
complex domain from the vector results presented in Eq. (4.3) and (4.4). Thus,

( ) ( ) ( )
(4.6)
( ) √ ( ) √ ( )
(4.7)

The reason why the back transformation into the complex domain is not correct is that the
dimensions of the complex plane are not orthogonal based on the Hadamard product. The
Hadamard product between orthogonal random unit directions should be:

̂ ̂ [ ]
(4.8)
However, the true behavior of the complex dimensions is:

̂ ̂ [ ]
(4.9)

This inconsistency is more evident when we consider the Hadamard product of the same unit
direction vector (the imaginary direction):

̂ ̂ [ ] ̂
(4.10)

Thus, even though the vector representation of the variance and standard deviation of
complex numbers is correct, these expressions cannot be directly transformed back into the

04/06/2019 ForsChem Research Reports 2019-06 (14 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

complex domain because the Hamadard product of non-orthogonal dimensions was used in
the process.

On the other hand, if the complex random variable is treated as a scalar, using the algebra of
random variables yields:

( ) ( ) ( )
(4.11)
( ) ( ) ( ) ( )
(4.12)
( ) √ ( ) ( ) ( )
(4.13)

Thus, as previously mentioned, only the expected value can be transformed back from the
vector representation into the complex domain since it does not involves Hadamard products.

Regarding the variance of complex random variables, it is important to mention that it has
been usually defined as:[7]

( ) (‖ ( )‖ ) (( ( )) ( ( )) ) ( ) ( )
(4.14)

Furthermore, the result presented in Eq. (4.12) has usually been denoted as “pseudo-variance”.

Let us take a look at the definition given in Eq. (4.14). If we define the complex random variable
as follows:
( )
(4.15)
where
( ) ( ) ( )
(4.16)
Then, Eq. (4.14) becomes:

( ) (‖ ( )‖ ) (‖ ‖ )
(4.17)

Another equivalent representation of Eq. (4.14) is:

( ) ‖ ( )‖
(4.18)

04/06/2019 ForsChem Research Reports 2019-06 (15 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

According to Eq. (3.16): ‖ ( )‖ (‖ ‖), and then it is possible to state that for this
definition of the variance:

( ) (‖ ‖)
(4.19)

Thus, the variance of a complex variable considered in Eq. (4.14) is not equivalent to the
variance of its modulus. Please also notice that according to the equivalent representations
given in Eq. (4.17) and (4.18), ( ) is related to the squared norm of a vector. While the
definition given in Eq. (4.14) might have some useful purposes for quantifying the variation of a
complex random variable, it does not denote the true variance of the complex random
variable. This might be clear if we consider that under the assumption of a vector
representation of the complex random variable, the variance of a vector ( ) should be a vector
( ( )), not a scalar ( ( )). Furthermore, it is not consistent with the variance of a
complex random variable ( ( )) when it is considered as a scalar (Eq. 4.12).

As a final note, it is important to remark that the mathematical behavior of the moments and
the probability density function of complex random variables are different to that of real
random variables. Thus, results such as negative and complex variances (or variances equal to
zero) are possible, and should not be interpreted as a measure of variability, as it is usually
done with the variance of real random variables. The variance, as all other moments of complex
random variables, is just a mathematical descriptor of the particular random variable
considered.

5. Conclusion

In this report it was shown that it is possible to extend the algebra of random variables to
mathematical arrays of random variables. This is done by means of the Hadamard or Schur
element-wise product. Thus, the most relevant properties and parameters of the random array
are represented also by arrays preserving the dimensions of the random variable. A fully
consistent algebra of random arrays is obtained when the different elements of the array are
orthogonal when the Hadamard product is used. Otherwise, the results must be used carefully
in order to avoid erroneous conclusions. That is the case for example of the vector
representation of complex random variables. Finally, while the variance of a complex random
variable has been denoted as a “pseudo-variance” in the scientific literature, it is actually the
true variance of the complex variable, even though its interpretation as a measure of variability
is no longer valid, as it only applies to real variables.

04/06/2019 ForsChem Research Reports 2019-06 (16 / 17)


www.forschem.org
Algebra of Random Arrays
Hugo Hernandez
ForsChem Research
hugo.hernandez@forschem.org

Acknowledgments

The author gratefully acknowledges Prof. Jaime Aguirre (Universidad Nacional de Colombia)
for helpful discussions and for reading the manuscript.

This research did not receive any specific grant from funding agencies in the public,
commercial, or not-for-profit sectors.

References

[1] Styan, G. P. (1973). Hadamard products and multivariate statistical analysis. Linear algebra
and its applications, 6, 217-240.

[2] Hernandez, H. (2018). The Realm of Randomistic Variables. ForsChem Research Reports
2018-10. doi: 10.13140/RG.2.2.29034.16326.

[3] Hernandez, H. (2017). Multivariate Probability Theory: Determination of Probability Density


Functions. ForsChem Research Reports 2017-13. doi: 10.13140/RG.2.2.28214.60481.

[4] Hernandez, H. (2018). Expected Value, Variance and Covariance of Natural Powers of
Representative Standard Random Variables. ForsChem Research Reports 2018-08. doi:
10.13140/RG.2.2.15187.07205.

[5] Deaux, R. (2013). Introduction to the geometry of complex numbers. Courier Corporation.

[6] Spiegel, M. R. (1978). Complex variables. McGraw-Hill.

[7] Chen, X., Ning, Y., & Wang, X. (2017). Formulas to calculate the variance and Pseudo-
variance of complex uncertain variable. In Proceedings of the fourth international forum on
decision sciences (pp. 361-376). Springer, Singapore.

04/06/2019 ForsChem Research Reports 2019-06 (17 / 17)


www.forschem.org

You might also like