General Bivariate Normal - Duke University
Lecture 22: Bivariate Normal Distribution
Statistics 104
Colin Rundel
April 11, 2012
6.5 Conditional Distributions
General Bivariate Normal
Let Z1, Z2 N (0, 1), which we will use to build a general bivariate normal distribution.
1 f (z1, z2) = 2 exp
-
1 2
(z12
+
z22)
We want to transform these unit normal distributions to have the follow arbitrary parameters: ?X , ?Y , X , Y ,
X = X Z1 + ?X Y = Y [Z1 + 1 - 2Z2] + ?Y
6.5 Conditional Distributions
General Bivariate Normal - Marginals
First, lets examine the marginal distributions of X and Y ,
X = X Z1 + ?X = X N (0, 1) + ?X = N (?X , X2 )
Y = Y [Z1 + 1 - 2Z2] + ?Y = Y [N (0, 1) + 1 - 2N (0, 1)] + ?Y = Y [N (0, 2) + N (0, 1 - 2)] + ?Y = Y N (0, 1) + ?Y = N (?Y , Y2 )
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 1 / 22
6.5 Conditional Distributions
General Bivariate Normal - Cov/Corr
Second, we can find Cov (X , Y ) and (X , Y )
Cov (X , Y ) = E [(X - E (X ))(Y - E (Y ))]
= E (X Z1 + ?X - ?X )(Y [Z1 + 1 - 2Z2] + ?Y - ?Y )
= E (X Z1)(Y [Z1 + 1 - 2Z2])
= X Y E Z12 + = X Y E [Z12] = X Y
1 - 2Z1Z2
Cov (X , Y )
(X , Y ) =
=
X Y
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 2 / 22
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 3 / 22
6.5 Conditional Distributions
General Bivariate Normal - RNG
Consequently, if we want to generate a Bivariate Normal random variable with X N (?X , X2 ) and Y N (?Y , Y2 ) where the correlation of X and Y is we can generate two independent unit normals Z1 and Z2 and use the transformation:
X = X Z1 + ?X Y = Y [Z1 + 1 - 2Z2] + ?Y
We can also use this result to find the joint density of the Bivariate Normal using a 2d change of variables.
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 4 / 22
6.5 Conditional Distributions
General Bivariate Normal - Density
The first thing we need to find are the inverses of the transformation. If x = r1(z1, z2) and y = r2(z1, z2) we need to find functions h1 and h2 such that Z1 = s1(X , Y ) and Z2 = s2(X , Y ).
X = X Z1 + ?X
Z1
=
X
- ?X X
Therefore,
Y = Y [Z1 + 1 - 2Z2] + ?Y
Y - ?Y
=
X
-
?X
+
Y
X
1 - 2Z2
Z2 =
1
Y
- ?Y
X -
- ?X
1 - 2 Y
X
s1(x, y )
=
x
- ?X X
Statistics 104 (Colin Rundel)
s2(x, y ) =
Lecture 22
1
y - ?Y - x - ?X
1 - 2 Y
X
April 11, 2012
6 / 22
6.5 Conditional Distributions
Multivariate Change of Variables
Let X1, . . . , Xn have a continuous joint distribution with pdf f defined of S. We can define n new random variables Y1, . . . , Yn as follows:
Y1 = r1(X1, . . . , Xn) ? ? ? Yn = rn(X1, . . . , Xn)
If we assume that the n functions r1, . . . , rn define a one-to-one differentiable transformation from S to T then let the inverse of this transformation be
x1 = s1(y1, . . . , yn) ? ? ? xn = sn(y1, . . . , yn) Then the joint pdf g of Y1, . . . , Yn is
Where
g (y1, . . . , yn) =
f (s1, . . . , sn)|J| 0
for (y1, . . . , yn) T otherwise
s1
y1
???
s1
yn
J
=
det
...
...
...
sn y1
???
sn yn
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 5 / 22
6.5 Conditional Distributions
General Bivariate Normal - Density
Next we calculate the Jacobian,
s1 s1
1
J = det
x s2
y s2
= det
-X
x y
X 1-2
0 1
Y 1-2
1 =
X Y 1 - 2
The joint density of X and Y is then given by
f (x, y ) = f (z1, z2)|J|
1 = exp
2
-
1 2
(z12
+
z22 )
1 |J| =
2X Y
exp 1 - 2
1 -
2
(z12
+
z22 )
1
1
=
exp -
2X Y 1 - 2
2
x - ?X
2
+
1
X
1 - 2
y - ?Y - x - ?X 2
Y
X
1
-1
=
exp
2X Y (1 - 2)1/2
2(1 - 2)
(x - ?X )2 X2
+
(y - ?Y )2 Y2
- 2 (x - ?X ) X
(y
- ?Y ) Y
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 7 / 22
6.5 Conditional Distributions
General Bivariate Normal - Density (Matrix Notation)
Obviously, the density for the Bivariate Normal is ugly, and it only gets worse when we consider higher dimensional joint densities of normals. We can write the density in a more compact form using matrix notation,
x=
x y
?=
?X ?Y
=
X2 X Y X Y Y2
f (x) = 1 (det )-1/2 exp - 1 (x - ?)T -1(x - ?)
2
2
We can confirm our results by checking the value of (det )-1/2 and (x - ?)T -1(x - ?) for the bivariate case.
(det )-1/2 =
X2 Y2 - 2X2 Y2
-1/2
=
1 X Y (1 -
2)1/2
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 8 / 22
6.5 Conditional Distributions
General Bivariate Normal - Examples
6.5 Conditional Distributions
General Bivariate Normal - Density (Matrix Notation)
Recall for a 2 ? 2 matrix,
A=
ab cd
A-1 = 1 det A
d -b -c a
1 =
ad - bc
d -b -c a
Then,
(x - ?)T -1(x - ?)
1 = X2 Y2 (1 - 2)
1 = X2 Y2 (1 - 2)
1 = X2 Y2 (1 - 2)
x - ?x T y - ?y
Y2 -X Y
-X Y X2
Y2 (x - ?X ) - X Y (y - ?Y ) T -X Y (x - ?X ) + X2 (y - ?Y )
x - ?x y - ?y
x - ?x y - ?y
Y2 (x - ?X )2 - 2X Y (x - ?X )(y - ?Y ) + X2 (y - ?Y )2
1 = 1 - 2
(x
- ?X )2 X2
(x - 2
- ?X )(y - ?Y ) X Y
+
(y
- ?Y )2 Y2
Statistics 104 (Colin Rundel)
Lecture 22
6.5 Conditional Distributions
General Bivariate Normal - Examples
April 11, 2012 9 / 22
X N (0, 1), Y N (0, 1) =0
Statistics 104 (Colin Rundel)
X N (0, 2), Y N (0, 1) =0
Lecture 22
X N (0, 1), Y N (0, 2) =0
April 11, 2012 10 / 22
X N (0, 1), Y N (0, 1) = 0.25
Statistics 104 (Colin Rundel)
X N (0, 1), Y N (0, 1) = 0.5
Lecture 22
X N (0, 1), Y N (0, 1) = 0.75
April 11, 2012 11 / 22
6.5 Conditional Distributions
General Bivariate Normal - Examples
6.5 Conditional Distributions
General Bivariate Normal - Examples
X N (0, 1), Y N (0, 1) = -0.25
X N (0, 1), Y N (0, 1) = -0.5
X N (0, 1), Y N (0, 1) = -0.75
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 12 / 22
6.5 Conditional Distributions
Multivariate Normal Distribution
Matrix notation allows us to easily express the density of the multivariate normal distribution for an arbitrary number of dimensions. We express the k-dimensional multivariate normal distribution as follows,
X Nk (?, ) where ? is the k ? 1 column vector of means and is the k ? k covariance matrix where {}i,j = Cov (Xi , Xj ).
The density of the distribution is
f (x) = 1 (det )-1/2 exp (2)k/2
- 1 (x - ?)T -1(x - ?) 2
X N (0, 1), Y N (0, 1) = -0.75
X N (0, 2), Y N (0, 1) = -0.75
X N (0, 1), Y N (0, 2) = -0.75
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 13 / 22
6.5 Conditional Distributions
Multivariate Normal Distribution - Cholesky
In the bivariate case, we had a nice transformation such that we could generate two independent unit normal values and transform them into a sample from an arbitrary bivariate normal distribution.
There is a similar method for the multivariate normal distribution that takes advantage of the Cholesky decomposition of the covariance matrix.
The Cholesky decomposition is defined for a symmetric, positive definite matrix X as
L = Chol(X) where L is a lower triangular matrix such that LLT = X.
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 14 / 22
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 15 / 22
6.5 Conditional Distributions
Multivariate Normal Distribution - RNG
Let Z1, . . . , Zk N (0, 1) and Z = (Z1, . . . , Zk )T then
? + Chol()Z Nk (?, ) this is offered without proof in the general k-dimensional case but we can check that this results in the same transformation we started with in the bivariate case and should justify how we knew to use that particular transformation.
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 16 / 22
6.5 Conditional Distributions
Cholesky and the Bivariate Transformation
Let Z1, Z2 N (0, 1) then
X Y
= ? + Chol()Z
=
?X ?Y
+
X
0
Y Y (1 - 2)1/2
Z1 Z2
=
?X ?Y
+
X Z1 Y Z1 + Y (1 - 2)1/2Z2
X = ?X + X Z1 Y = ?Y + Y [Z1 + (1 - 2)1/2Z2]
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 18 / 22
6.5 Conditional Distributions
Cholesky and the Bivariate Transformation
We need to find the Cholesky decomposition of for the general bivariate
case where
=
X2 X Y
X Y Y2
We need to solve the following for a, b, c
a0 bc
ab 0c
=
a2
ab
ab b2 + c2
=
X2 X Y
X Y Y2
This gives us three (unique) equations and three unknowns to solve for,
a2 = X2
ab = X Y
b2 + c2 = Y2
a = X b = X Y /a = Y c = Y2 - b2 = Y (1 - 2)1/2
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 17 / 22
6.5 Conditional Distributions
Conditional Expectation of the Bivariate Normal
Using X = ?X + X Z1 and Y = ?Y + Y [Z1 + (1 - 2)1/2Z2] where Z1, Z2 N (0, 1) we can find E (Y |X ).
E [Y |X = x] = E ?Y + Y Z1 + (1 - 2)1/2Z2 X = x
=E
?Y + Y
x
- ?X X
+ (1 - 2)1/2Z2
X =x
= ?Y + Y
x
- ?X X
+ (1 - 2)1/2E [Z2|X
= x]
= ?Y + Y
x - ?X X
By symmetry,
E [X |Y = y ] = ?X + X
y - ?Y Y
Statistics 104 (Colin Rundel)
Lecture 22
April 11, 2012 19 / 22
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- math 121 homework 7 notes on selected problems
- numerical integration another approach
- latex math mode
- 1 sqrt 10 1 011010100000100 2 sqrt 10 10 1
- on fast convergence of proximal algorithms for sqrt lasso
- mipt spring camp 2016 day 2 theme sqrt decomposition
- in 1 this is a basic tutorial introducing you to sympy
- preconditions and postconditions
- evaluation of the complete elliptic integrals by
- square roots via newton s method
Related searches
- duke university nonprofit certificate program
- duke university nonprofit management program
- duke university certificate in nonprofit
- is duke university a 501c3
- duke university executive leadership program
- duke university nonprofit leadership
- duke university ein number
- duke university hospital leadership
- duke university directions
- duke university certificate program online
- duke university graduate certificate programs
- duke university undergraduate application