Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
4
2
x2
0
−2
−4 −2 0 2 4
x1
1 1 1
4.4. Let X be N3 (µ, Σ) with µT = (2, −3, 1) and Σ = 1 3 2
1 2 2
Sol. (a) Let a = (3, −2, 1)T , then aT X = 3X1 − 2X2 + X3 . Therefore,
aT X ∼ N (aT µ, aT Σa),
where
2
aT µ = 3 −2 1 −3 = 13
1
and
1 1 1 3
T
a Σa = 3 −2 1 1 3 2 −2 = 9
1 2 2 1
The distribution of 3X1 − 2X2 + X3 is N3 (13, 9).
T T X1
(b) Let a = a1 a2 , then Y = X2 − a = −a X + X2 − a2 X3 .
X3 1 1
0 1 0 X2
Now, let A = , then AX = ∼ N (Aµ, AΣAT ), where
−a1 1 −a2 Y
1 1 1 0 −a1
0 1 0
AΣAT = 1 3 2 1 1
−a1 1 −a2
1 2 2 0 −a2
3 −a1 − 2a2 + 3
=
−a1 − 2a2 + 3 a21 − 2a1 − 4a2 + 2a1 a2 + 2a22 + 3
2
Since we want to have X2 and Y independent, this implies that −a1 − 2a2 + 3 = 0.
So we have vector
3 −2
a= +c , for c ∈ R
0 1
4 0 −1
4.6. Let X be distributed as N3 (µ, Σ), where µT = (1, −1, 2) and Σ = 0 5 0 . Which
−1 0 2
of the following random variables are independent? Explain.
(a) X1 and X2
(b) X1 and X3
(c) X2 and X3
(d) (X1 , X3 ) and X2
(e) X1 and X1 + 3X2 − 2X3
X1 X2 = x2 ∼ N µ1 + Σ12 Σ−1 −1
22 (x2 − µ2 ), Σ11 − Σ12 Σ22 Σ21
3
(a)
X1 X3 = x3 ∼ N 1 + (−1)(2)−1 (x3 − 2), 4 − (−1)(2)−1 (−1)
1
⇒ X1 X3 = x3 ∼ N − x3 + 2,
2
(b)
X1 X2 = x2 , X3 = x3
!
5 0 −1 x2 − (−1) 5 0 −1 0
∼ N 1 + 0 −1 , 4 − 0 −1
0 2 x3 − 2 0 2 −1
1
⇒ X1 X2 = x2 , X3 = x3 ∼ N − x3 + 2,
2
4.16. Let X1 , X2 , X3 , and X4 be independent Np (µ, Σ) random vectors.
(a) Find the marginal distributions for each of the random vectors
1 1 1 1
V1 = X1 − X2 + X3 − X4
4 4 4 4
and
1 1 1 1
V2 = X1 + X2 − X3 − X4
4 4 4 4
(b) Find the joint density of the random vectors V1 and V2 defined in (a).
Sol. (a) By result 4.8 in the textbook, V1 and V2 have the following distribution
n n
! !
X X
Np ci µ, c2i Σ
i=1 i=1
4.18. Find the maximum likelihood estimates of the 2×1 mean vector µ and the 2×2 covariance
matrix Σ based on the random sample
3 6
4 4
X= 5 7
4 7
from a bivariate normal population.
4
Sol. Since the random samples X1 , X2 , X3 , and X4 are from normal population, the maximum
n
1X
likelihood estimates of µ and Σ are X̄ and (Xi − X̄)(Xi − X̄)T . Therefore,
n i=1
4
4 1X T 1/2 1/4
µ̂ = X̄ = and Σ =
b (Xi − X̄)(Xi − X̄) =
6 4 i=1 1/4 3/2
5
20
Sample Quantiles
10
0
−10
Using the information from the data, we have rQ = 0.9351. The R code of this
calculation is compiled in Appendix. From Table 4.2 in the textbook we know that
the critical point to test of normality at the 10% level of significance corresponding
to n = 9 and α = 0.1 is between 0.9032 and 0.9351. Since rQ = 0.9351 > the critical
point, we do not reject the hypothesis of normality.
4.26. Exercise 1.2 gives the age x1 , measured in years, as well as the selling price x2 , measured
in thousands of dollars, for n = 10 used cars. These data are reproduced as follows:
x1 1 2 3 3 4 5 6 8 9 11
x2 18.95 19.00 17.95 15.54 14.00 12.95 8.94 7.49 6.00 3.99
(a) Use the results of Exercise 1.2 to calculate the squared statistical distances
(xj − x̄)T S −1 (xj − x̄), j = 1, 2, . . . , 10, where xTj = (xj1 , xj2 ).
(b) Using the distances in Part (a), determine the proportion of the observations falling
within the estimated 50% probability contour of a bivariate normal distribution.
(c) Order the distances in Part (a) and construct a chi-square plot.
(d) Given the results in Parts (b) and (c), are these data approximately bivariate normal?
Explain.
x̄1 5.2 10.6222 −17.7102
Sol. (a) From Exercise 1.2 we have x̄ = = and S = .
x̄2 12.481 −17.7102 30.8544
The squared statistical distances d2j = (xj − x̄)T S −1 (xj − x̄), j = 1, . . . , 10 are cal-
culated and listed below
d21 d22 d23 d24 d25 d26 d27 d28 d29 d210
1.8753 2.0203 2.9009 0.7352 0.3105 0.0176 3.7329 0.8165 1.3753 4.2152
6
(b) We plot the data points and 50% probability contour (the blue ellipse) in Figure
3. It is clear that subject 4, 5, 6, 8, and 9 are falling within the estimated 50%
probability contour. The proportion of that is 0.5.
1 2
3
15
5
x2 6
10
9
5
10
2 4 6 8 10
x1
(c) The squared distances in Part (a) are ordered as below. The chi-square plot is shown
in Figure 4.
d26 d25 d24 d28 d29 d21 d22 d23 d27 d210
0.0176 0.3105 0.7353 0.8165 1.3753 1.8753 2.0203 2.9009 3.7329 4.2153
4
Sample Quantiles
3
2
1
0
0 2 4 6 8 10 12 14
Theoretical Quantiles
(d) Given the results in Parts (b) and (c), we conclude these data are approximately
bivariate normal. Most of the data are around the theoretical line.
7
Appendix
R code for Problem 4.2 (c).
> library(ellipse)
> library(MASS)
> library(mvtnorm)
> set.seed(123)
>
> mu <- c(0,2)
> Sigma <- matrix(c(2,sqrt(2)/2,sqrt(2)/2,1), nrow=2, ncol=2)
> X <- mvrnorm(n=10000,mu=mu, Sigma=Sigma)
> lambda <- eigen(Sigma)$values
> Gamma <- eigen(Sigma)$vectors
> elps <- t(t(ellipse(Sigma, level=0.5, npoints=1000))+mu)
> chi <- qchisq(0.5,df=2)
> c <- sqrt(chi)
> factor <- c*sqrt(lambda)
> plot(X[,1],X[,2])
> lines(elps)
> points(mu[1], mu[2])
> segments(mu[1],mu[2],factor[1]*Gamma[1,1],factor[1]*Gamma[2,1]+mu[2])
> segments(mu[1],mu[2],factor[2]*Gamma[1,2],factor[2]*Gamma[2,2]+mu[2])
> x <- c(-0.6, 3.1, 25.3, -16.8, -7.1, -6.2, 25.2, 22.6, 26.0)
> # (a)
> qqnorm(x)
> qqline(x)
> # (b)
> y <- sort(x)
> n <- length(y)
> p <- (1:n)-0.5)/n
> q <- qnorm(p)
> rQ <- cor(y,q)
> n <- 10
> x1 <- c(1,2,3,3,4,5,6,8,9,11)
> x2 <- c(18.95, 19.00, 17.95, 15.54, 14.00, 12.95, 8.94, 7.49, 6.00, 3.99)
> X <- cbind(x1,x2)
> Xbar <- colMeans(X)
> S <- cov(X)
> Sinv <- solve(S)
>
> # (a)
> d <- diag(t(t(X)-Xbar)%*%Sinv%*%(t(X)-Xbar))
>
> # (b)
> library(ellipse)
8
> p <- 2
> elps <- t(t(ellipse(S, level=0.85, npoints=1000))+Xbar)
> plot(X[,1],X[,2],type="n")
> index <- d < qchisq(0.5,df=p)
> text(X[,1][index],X[,2][index],(1:n)[index],col="blue")
> text(X[,1][!index],X[,2][!index],(1:n)[!index],col="red")
> lines(elps,col="blue")
>
> # (c)
> names(d) <- 1:10
> sort(d)
> qqplot(qchisq(ppoints(500),df=p), d, main="",
+ xlab="Theoretical Quantiles", ylab="Sample Quantiles")
> qqline(d,distribution=function(x){qchisq(x,df=p)})