Sei sulla pagina 1di 9

1 Random variables, distributions, multidimen-

sional random variables


1. Show that the mean of N (, 2 ) is
Solution. Use the change of variable u = x :
Z
E(X) = xfX (x)dx

1 Z (x) 2

= xe 22 dx
2
1 Z u2
= (u + )e 22 du
2
1 Z u22 1 Z u22
= ue 2 du + e 2 du
2 2
At this point we can recognise the second integral as the integral of a N (0, 2 )
r.v being integrated over all its range, so we can use the normalisation property
to get
1 Z u22
E(X) = ue 2 du + 1
2
Here we can tackle the remaining integral either by noting that u is an odd
u2 u2
function and e 22 is even so that ue 22 is odd and its integral over (, )
u2 u2
u2
this gives ue 22 du = 2 e 22 +c,
R
is 0 or by making the substitution v = 2 2
,
u2
noting that e 22 goes to 0 as u or u gives the definite integral as
0.
2. Show the the variance of N (, 2 ) is 2
Solution.

Z
V ar(X) = (x )2 fX (x)dx

1 Z (x)2
= (x )2 e 22 dx
2
1 Z 2 u22
= u e 2 du
2

f g 0 du = [f g] gf 0 du, with f = u,
R R
Here we can use integration by parts,
u2 u2
f 0 = 1, g 0 = ue 22 and g = 2 e 22 . Then
Z
1  2
u2 u2 
V ar(X) = 2
[ ue 2 ] + 2
e 22 du
2
1 Z u22
= 2 e 2 du
2
= 2 1

3. Show that for any random variable X with a finite second moment E(X 2 ) < ,

V ar(X) = E(X 2 ) (EX)2

Solution. Denote E(X) by .

V ar(X) = E((X )2 )
= E(X 2 2X + 2 )
= E(X 2 ) 2E(X) + 2
= E(X 2 ) 2E(X) + 2
= E(X 2 ) 22 + 2
= E(X 2 ) 2 .

4. Derive the expression for the probability density of a LogNormal distribution.


1 (ln x)2
f (x) = e 22
2x
Hint: Write the Lognormal cdf in terms of Normal cdf, then differentiate.
Solution. Let X LN (, 2 ), i.e. X = eY where Y N (, 2 ). For x 0
FX (x) = P (X x) = 0, and for x > 0

FX (x) = P (X x) = P (eY x) = P (Y ln x) = FY (ln x).


d d
fX (x) = FX (x) = FY (ln x).
dx dx
Using the chain rule we obtain
d d 1
FY (ln x) = FY0 (ln x) ln x = fY (ln x) .
dx dx x

Since Y N (, 2 ),
1 (x)2
fY (x) = e 22 .
2
Therefore
1 (ln x)2
fY (ln x) = e 22 ,
2
and thus
1 (ln x)2
fX (x) = e 22 .
2x
5. X has N (20, 22 ) distribution and Y has N (0, 1) distribution and they are
independent.

(a) Give the distribution of the vector (X, Y ).


Solution.
The "distribution
# of the vector (X, Y ) is bivariate
" #normal with mean vector
20 4 0
= and covariance matrix = .
10 0 1
(b) Give the distribution of U = 2X 3Y , specify its mean and variance.
Solution.
h X i
We have that 2X 3Y = [2 3] , so we can use Theorem 11 with
Y
h 20 i
a = [2 3]. For the mean we have a = [2 3] = 40 30 = 10 and
10
h 4 0 ih 2 i
aaT = [2 3] = 16 + 9 = 25. So 2X 3Y N (10, 52 ).
0 1 3
(c) Using Excel, simulate 100 values of U . Give the mean and standard
deviation of these values and compare to the numbers above.
Solution.
We can simulate a N (0, 1) r.v. in Excel (using the inverse transform
method) by entering =NORMSINV(RAND()). Using Theorem 2, we
then need to enter =10 + 5 * NORMSINV(RAND()) to simulate U .
The mean and standard deviation of the simulated values can then be
obtained using Excel functions, these values will be close to (but not
exactly) 10 and 5.
Alternatively, we can also simulate U by finding the differences between
cells containing =20 + 2 * NORMSINV(RAND()) and =10 + 1 *
NORMSINV(RAND()).

6. X has N (20, 22 ) distribution and Y has N (0, 1) distribution, and X and Y are
correlated with correlation = 0.5.

(a) Give the covariance between X and Y


Solution.
Rearranging the formula for correlation (given on p.13 of lec notes) gives
q
Cov(X, Y ) = V ar(x)V ar(Y ) = 0.5 4 1 = 1.
(b) Give the distribution of the vector (X, Y ).
Solution.
The "distribution
# of the vector (X, Y ) is bivariate
" #normal with mean vector
20 4 1
= and covariance matrix = .
10 1 1
(c) Give the distribution of U = 2X 3Y , specify its mean and variance.
Solution.
h 20 i
Using Theorem 11 again, U is normal with mean a = [2 3] =
10
h 4 1 ih 2 i
40 30 = 10 and variance aaT = [2 3] = 10 + 3 = 13.
1 1 3
(d) Using Excel, simulate 100 values of U. Give the mean and the standard
deviation of these values and compare to the numbers in above.
Solution.
We can simulate U by simulating two correlated N (0, 1) random variables
using Z1 = N ORM SIN V (RAN D()) and then = 0.5Z1 +SQRT (1
0.5 0.5) N ORM SIN V (RAN D()) where Z1 is the location of the first
normal. From there we can find X and Y by adding the means, scaling by
the standard deviations, then U by multiplying X by 2 and subtracting
3 times Y from it.
Alternatively, we can simulate U by entering =10 + SQRT(13) * NORM-
SINV(RAND()).
The mean and standard deviation we then obtain will be close to (but
not exactly) 10 and 13 3.6.

7. Let X and Y by random variables with E(X) = 20, V ar(X) = 4, and E(Y ) =
10, V ar(Y ) = 1, = 0.5.
Find the covariance and the correlation between X and U = 2X 3Y
Solution.
Rearranging the formula for correlation gives
q
Cov(X, Y ) = V ar(X)V ar(Y )

= 0.5 4 1
= 1.

We use the properties of covariance on p.14 of the notes,

Cov(X, U ) = Cov(X, 2X 3Y )
= (1)(2)Cov(X, X) + (1)(3)Cov(X, Y )
= 2V ar(X) 3Cov(X, Y )
= 2431
= 5.
Cov(X,U )
By the definition of correlation we have Corr(U, X) = .
V ar(X)V ar(U )
We need V ar(U ),

V ar(U ) = Cov(U, U )
= Cov(2X 3Y, 2X 3Y )
= 4Cov(X, X) + 2(2)(3)Cov(X, Y ) + (3)(3)Cov(Y, Y )
= 4V ar(X) 12Cov(X, Y ) + 9V ar(Y, Y )
= 4 4 12 1 + 9 1
= 13.

Hence Corr(U, X) = 5 = 5 = 5 13
.
134 2 13 26

8. Let X1 and X2 both have Lognormal LN (0, 1) and are independent. Find the
following:

(a) P (X1 > 2).


Solution.
We can write X1 = eZ1 where Z1 N (0, 1). Thus

P (X1 > 2) = P (eZ1 > 2)


= P (Z1 > ln 2)
= 1 (ln 2)
= 0.244

(b) Distribution of X1 X2 and P (X1 > 2/X2 ).


Solution.
We can write X1 = eZ1 and X2 = eZ2 . Then Z1 and Z2 are independent
N (0, 1). Using Theorem 11 with a = [1, 1], we have that Z1 + Z2
N (0, 2). Hence X1 X2 = eZ1 +Z2 is LN (0, 2).

P (X1 > 2/X2 ) = P (X1 X2 > 2)


= P (eZ1 +Z2 > 2)
= P (Z1 + Z2 > ln 2)
ln 2
= P (Z > )
2
ln 2
= 1 P (Z )
2
 ln 2 
= 1
2

(c) Distribution of X1 /X2 and P (X1 > 2X2 ).


Solution. Theorem 2 tells us that aZ2 N (0, a2 1), hence aZ2
N (0, (1)2 1). So Z1 Z2 = Z1 + (1)Z2 N (0, 2), and X1 /X2 = eZ1 /eZ2 =
eZ1 Z2 is LN (0, 2).

P (X1 > 2X2 ) = P (X1 /X2 > 2)



2Z
= P (e > 2)
 ln 2 
= 1 .
2
" #
1
9. X = (X, Y ) is N (0, ), with = .
1

(a) Find P (X > Y ). Hint: write this as P (X Y > 0) and use Theorem 11,
p.18 in the Notes.
Solution. " #
X
P (X > Y ) = P (X Y > 0). Now notice that X Y = [1 1] .
Y
Thus, by Theorem 11, X Y is N (a,"aaT ).# " #
T 1 1
We have a = 0 and aa = [1 1] = 2 2,
1 1
i.e. X Y N (0, 2 2). Therefore,
1
P (X > Y ) = P (X Y > 0) = .
2
Remark: there is no need to calculate the variance. Once we know that
the distribution of X Y is Normal with mean zero, it is symmetric about
0 so that P (X Y > 0) = 0.5.
(b) Write an integral epxression for P (X D) where D is a set on the plane.
Evaluate it for D = {(x, y) : x y}.
Solution.
Let fX,Y (x, y) be the joint density of X and Y . Then,
Z Z
P (X D) = fX,Y (x, y)dxdy.
(x,y)D

For D = {(x, y) : x y}, P (X D) = P (X Y ) = 1 P (X > Y ) = 12


(follows from (a)). This can also be obtained by noting fX,Y is symmetric
about the origin and that we are integrating over precisely half of its
possible domain.
10. Let random variables X and Y be independent Normal with distributions
N (1 , 12 ) and N (2 , 22 ). Show that the distribution of (X, X "+ Y ) is bivariate
#
12 12
Normal with mean vector (1 , 1 +2 ) and covariance matrix .
12 12 + 22
Hint: If Z = (Z1 , Z2 ) has standard normal components, show that
" # " # " #" #
X 1 1 0 Z1
= + .
X +Y 1 + 2 1 2 Z2
| {z } | {z } | {z }
A Z

Solution. Let Z1 and Z2 be two independent standard Normal random vari-


ables. Then we can represent X and Y as

X = 1 + 1 Z1 , Y = 2 + 2 Z2

and thus X + Y = 1 + 2 + 1 Z1 + 2 Z2 . So we have


" # " # " # " #" #
X 1 + 1 Z1 1 1 0 Z1
= = + .
X +Y 1 + 2 + 1 Z1 + 2 Z2 1 + 2 1 2 Z2
" # " #
X 1
Hence N (, ) where = and
X +Y 1 + 2
" #" # " #
T 1 0 1 1 12 12
= AA = = .
1 2 0 2 12 12 + 22

11. Rule for transformation of covariances in linear transformation of


random vectors. Let the random vector (X, Y ) have covariance matrix ,
and
" # " #
U X
=A
V Y

for some non-random matrix A. Derive the formula for (U,V ) , the covariance
matrix of (U, V ),
(U,V ) = A(X,Y ) AT .

(a) By using vector-matrix multiplication and properties of the covariance.


Solution. " #
V ar(U ) Cov(U, V )
Recall that (U,V ) = .
Cov(U, V ) V ar(V )
" # " # " #" #
a11 a12 U a11 a12 X
Let A = . Then = , that is,
a21 a22 V a21 a22 Y
U = a11 X + a12 Y and V = a21 X + a22 Y .
By the properties of covariance, we have
V ar(U ) = Cov(U, U ) = Cov(a11 X + a12 Y, a11 X + a12 Y )

= a211 V ar(X) + 2a11 a12 Cov(X, Y ) + a212 V ar(Y ),


Cov(U, V ) = Cov(a11 X + a12 Y, a21 X + a22 Y )

= a11 a21 V ar(X) + (a11 a22 + a12 a21 )Cov(X, Y ) + a12 a22 V ar(Y ), and

V ar(V ) = Cov(V, V ) = Cov(a21 X + a22 Y, a21 X + a22 Y )

= a221 V ar(X) + 2a21 a22 Cov(X, Y ) + a222 V ar(Y ).

Substitute these values back into the matrix (U,V ) , we find that this is
equivalent to
" #" #" #
a11 a12 V ar(X) Cov(X, Y ) a11 a21
(U,V ) = = A(X,Y ) AT .
a21 a22 Cov(X, Y ) V ar(Y ) a12 a22

(b) Assume (X, Y ) is bivariate Normal. Derive the formula for (U,V ) using
representations for multivariate normal and matrix multiplication.
Solution. " # " #
X Z1
Since (X, Y ) is Normal, it has representation = (X,Y ) + B
Y Z2
T
for some matrix B such that (X,Y ) = BB . Thus,
" # " # " #
U X Z1
=A = A(X,Y ) + AB .
V Y Z2

It follows that (U,V ) = A(X,Y ) and

(U,V ) = AB(AB)T = ABB T AT = A(X,Y ) AT .

12. Show that the average of n independent identically distributed Normal random
variables N (, 2 ) is a Normal random variable with mean and variance 2 /n
Solution.
Let X be multivariate normal with mean vector


.
.
.

and n n covariance matrix

2 0

0

0 2 0

= .. .. ... .. .
. . .


0 0 2
We are interested in n1 ni=1 Xi which is the same as aX where a is the 1 n
P

vector [ n1 n1 ]. Hence by Theorem 11, aX has mean




1 1
a = [ ] ...


n n


= + +
n n
=

and has variance


2 0

0 1
1 1

0 2 0 n
.
aaT = [ ] .. .. ... .. .
.
n n
. . . 1
0 0 2 n
1
2 n
2 .
] .

= [
n .

n 1

n
2 2
= 2
+ + 2
n n
n 2
=
n2
2
= .
n

13. Simulate two observations on the bivariate normal (X1 , X2 ) with mean 0,
V ar(X1 ) = 1, V ar(X2 ) = 4 and correlation = 0.9.
Solution. First, simulate a pair of independent standard normal Z1 and Z2 .
To do this in Excel, we first generate Uniform(0,1) random variable U using
command =rand(), then obtain Z1 from the inverse of standard Normal
distribution =normsinv(U ). Repeat the steps for Z2 . Then calculate
q
X1 = 1 + 1 Z1 and X2 = 2 + 2 Z1 + 1 2 2 Z2

where 1 = 2 = 0, 1 = 1, 2 = 2 and = 0.9.