Professional Documents
Culture Documents
Lect01 Handouts
Lect01 Handouts
Lect01 Handouts
September 8, 2017
1 / 45
Outline of the lecture
I Practical information
I Introductory examples (see also Chapter 1)
I A brief outline of the course
I Chapter 2:
I Multivariate random variables
I The multivariate normal distribution
I Linear projections
I Example
2 / 45
Contact info
3 / 45
What you should be able to do
Mink and Muskrat skins traded
in Canada 1850−1911
Mink
1500000
Muskrat
1000000
# of skins traded
500000
0
Years
4 / 45
What you should be able to do
Mink and Muskrat skins traded
in Canada 1850−1911
Mink
1500000
Muskrat
1000000
# of skins traded
500000
0
Years
5 / 45
What you should be able to do
Mink and Muskrat skins traded
in Canada 1850−1911
Mink
1500000
Muskrat
1000000
# of skins traded
500000
0
Years
6 / 45
Introductory example – shares (COLO B 1 month)
From finance.yahoo.com
7 / 45
Introductory example – shares (COLO B 1 year)
From finance.yahoo.com
8 / 45
Introductory example – shares (COLO B all)
From finance.yahoo.com
9 / 45
Introductory example – shares (COLO B log(all) )
From finance.yahoo.com
10 / 45
Number of Monthly Airline Passengers in the US
60000
Airline passengers
50000
40000
11 / 45
Consumption of District Heating (VEKS) – data
Heat Consumption (GJ/h)
2000
1200
800
5
0
−5
−10
12 / 45
Consumption of DH – simple model
2500
2000
Heat Consumption (GJ/h)
1500
1000
−15 −10 −5 0 5 10
14 / 45
Consumption of DH – model error
Model Error
Model Error (GJ/h)
400
0
−400
400
0
−400
15 / 45
A brief outline of the course
16 / 45
Today: Multivariate random variables
I Distribution functions
I Density functions
I The multivariate normal distribution
I Marginal densities
I Conditional distributions and independence
I Expectations and moments
I Moments of multivariate random variables
I Conditional expectation
I Distributions derived from the normal distribution
I Linear projections and relations to conditional means
17 / 45
Multivariate random variables – distr. functions
F (x1 , . . . , xn ) = P{X1 ≤ x1 , . . . , Xn ≤ xn }
18 / 45
Multivariate random variables - joint densities
F (x1 , . . . , xn ) = P{X1 ≤ x1 , . . . , Xn ≤ xn }
∂ n F (x1 , . . . , xn )
f (x1 , . . . , xn ) =
∂x1 . . . ∂xn
f (x1 , . . . , xn ) = P{X1 = x1 , . . . , Xn = xn }
19 / 45
The Multivariate Normal Distribution
20 / 45
Stochastic variables and distributions
0.4
0.3
0.3
Density
Density
0.2
0.2
0.1
0.1
0.0
-4 -2 0 2 4 0.0 -4 -2 0 2 4
X X
21 / 45
Marginal density function
I Sub-vector: (X1 , . . . , Xk )T , (k < n)
I Marginal density function:
Z ∞ Z ∞
fS (x1 , . . . , xk ) = ... f (x1 , . . . , xn ) dxk+1 . . . dxn
−∞ −∞
0.3
f
0.2
x2
0.1
x1
0.0
x2
9
-2 -1 0 1 2 3 4 -2 -1 0 1 2 3 4
x1 x1
22 / 45
Blackboard - conditional probability
23 / 45
Conditional distributions
I The conditional density of X1
given X2 = x2 is defined as
(joint density of (X1 , X2 ) divided by
(fX1 (x1 ) > 0):
the marginal density of X2 evaluated
at x2 )
fX1 ,X2 (x1 , x2 )
fX1 |X2 =x2 (x1 ) =
fX2 (x2 )
15
f
11
10
9
-2 -1 0 1 2 3 4 -2 -1 0 1 2 3 4
x1 x1
24 / 45
Independence
25 / 45
Expectation
26 / 45
Moments and Variance
I n’th moment: Z ∞
n
E[X ] = x n fX (x) dx
−∞
I n’th central moment:
Z ∞
n
E[(X − E[X]) ] = (x − E[X])n fX (x) dx
−∞
27 / 45
Covariance
I Covariance:
V [X] = Cov[X, X]
I Calculation rules:
I The calculation rule can be used for the variance as well. For
instance:
V [a + bX2 ] = b2 V [X2 ]
28 / 45
Moment representation
29 / 45
Expectation and Variance for Random Vectors
I Correlation:
Cov[Xi , Xj ] σij
ρij = p =
V [Xi ]V [Xj ] σi σj
30 / 45
Correlation and Independence
31 / 45
Expectation and Variance for Random Vectors
32 / 45
Conditional expectation
Z ∞
E[Y |X = x] = y fY |X=x (y ) dy
−∞
33 / 45
Variance separation
34 / 45
Linear Projections
def
I Define the linear projection ρX (Y ) = µY + Σ Y X Σ −1
XX (X − µX )
I Then:
I ρX (Y ) is of the form a + BX;
I V [Y − ρX (Y )] = Σ Y Y − Σ Y X Σ −1 T
XX Σ Y X ;
I Cov(Y − ρX (Y ), X) = 0.
35 / 45
Linear projections and conditional means
36 / 45
Air pollution in cities
I Carstensen (1990) has used time series analysis to set up models for
NO and NO2 at Jagtvej in Copenhagen
I Measurements of NO and NO2 are available every third hour (00,
03, 06, 09, 12, . . . )
I We have µNO2 = 48µg/m3 and µNO = 79µg/m3
I In the model X1,t = NO2,t − µNO2 and X2,t = NOt − µNO is used
37 / 45
Air pollution in cities – model and forecast
X1,t 0.9 −0.1 X1,t−1 ξ1,t
= +
X2,t 0.4 0.8 X2,t−1 ξ2,t
Xt = Φ Xt−1 + ξt
σ12
σ12 30 21
V [ξt ] = Σ = = (µg/m3 )2
σ21 σ22 21 23
38 / 45
Air pollution in cities – model and forecast
The forecast:
39 / 45
Air pollution in cities – forecast with R
## The system
mu <- matrix(c(48,79),nrow=2)
Phi <- matrix(c(.9,.4,-.1,.8),nrow=2)
Sigma <- matrix(c(20,21,21,23),nrow=2)
## The forecast of the concentrations
Xt <- matrix(c(64,93),nrow=2)-mu
Xtp1.hat <- Phi%*%Xt
Xtp1.hat + mu
## [,1]
## [1,] 61.0
## [2,] 96.6
40 / 45
Air pollution in cities – linear projection
41 / 45
Air pollution in cities – linear projection
42 / 45
Air pollution in cities – linear projection with R
## [1] 102.9
## [1] 0.95
43 / 45
Highlights
I Covariance calculation rule
I Linear projection:
def
(E[Y |X] =)ρX (Y ) = µY + Σ Y X Σ −1
XX (X − µX )
44 / 45
Exercises
45 / 45