$30
EPFL Multivariate Statistics
Week 2
Exercise 1 Let X ∼ Np(µ, Σ) a multivariate Gaussian random vector in R
p
. We consider the partition X =
(X0
1
, X0
2
)
0 where X1 ∈ R
k
, for 1 ≤ k < p and X2 ∈ R
p−k
.
1. Derive the conditional density of X1 | X2 = x2.
Hint : It might be easier to consider the precision matrix Σ
−1 = Ψ =
Ψ11 Ψ12
Ψ21 Ψ22
when writing the Gaussian
densities above.
2. Derive the marginal density of X1.
Exercise 2 We consider X ∼ Np(µX, ΣX) and Y | X = x ∼ Nq(α + βx, Σ) where µ ∈ R
p
, ΣX ∈ Rp×p
, α ∈ R
q
,
β ∈ R
q×p and Σ ∈ R
q×q
.
1. Prove that (X0
, Y0
)
0 ∼ Np+q, compute its mean and show that
V (X0
, Y0
)
0 =
ΣX ΣXβ
0
βΣX Σ + βΣXβ
0
Hint : Start by setting U = Y − α − βX and showing that X and U are independent, then find a matrix A
and a vector c such that (X0
, Y0
)
0 = A(X0
, U0
)
0 + c.
2. Show that the conditional distribution of X | Y = y is Gaussian with
E[X | Y = y] = µX + βΣX(Σ + βΣXβ
0
)
−1
(y − α − µXβ),
V [X | Y = y] = ΣX − ΣXβ
0
(Σ + βΣXβ
0
)
−1βΣX,
assuming that the matrices Σ, ΣX,(Σ + βΣXβ
0
) are invertible.
Exercise 3 Let X1, · · · , Xn be i.i.d. random vectors in R
p with mean µ and covariance matrix Σ. Consider the
sample mean X¯ and the sample variance-covariance matrix S and show that T
2
0 = n(X¯ −µ)
0 S
−1
(X¯ −µ) is invariant
under all the afine transformations Yi = AXi + b, where A is an invertible matrix of constants and b is a vector of
constants.
Exercise 4 (Simulation of Gaussian random vectors in R)
We consider the random vector X in R
2
from a standard gaussian distribution N2(0, 1).
1. Generate N = 1000 independent random replicates X1, . . . , Xn of X. Hint : The function rnorm(n) generates
n independent replicates of a univariate random distribution.
a) Estimate the sample mean and covariance matrix.
b) plot the sample and draw diagnostic plots of the marginal distributions.
2. We define another Gaussian vector Y satisfying : E [Y1] = 5, E [Y2] = 5, Var(Y1) = 1, Var(Y2) = 1 and
Cov(Y1, Y2) = 0.9.
a) Generate N = 1000 independent replicates Y1, . . . , Yn starting from X1, . . . , Xn.
Hint : The function chol computes the Choleski factorization of Σ and returns A such that A0A = Σ .
b) plot the sample and draw visual diagnostic plots of the marginal distributions.
1