You are on page 1of 5

G14FOS (Exam 2) Solutions 2013/14

R1R1
1. (a) We need to find k such that 0 0 fX,Y (x, y)dx dy = 1. Now
Z 1Z 1 Z 1
2 2
2kxy − kx y − kxy dx dy = [kx2 y − kx3 y/3 − kx2 y 2 /2]10 dy
0 0
Z0 1
= 2ky/3 − ky 2 /2 dy
0
= [2ky 2 /6 − ky 3 /6]10 = k/6.
Therefore k = 6.
fX,Y (x, y)
(b) The conditional pdf is fX|Y (x|y) = , where
fY (y)
Z 1
fY (y) = fX,Y (x, y)dx = 2ky/3 − ky 2 /2 = y(4 − 3y).
0

Therefore
6xy(2 − x − y) 6x(2 − x − y)
fX|Y (x|y) = =
y(4 − 3y) 4 − 3y
for 0 < x < 1.

2. (a) Let q = 1 − p. For the first success to occur in the kth trial, we observe k − 1
failures before the a success. Therefore P (X = 1) = p, P (X = 2) = qp,
P (X = 3) = q 2 p and in general

pX (k) = q k−1 p, k = 1, 2, . . . .

Clearly pX (k) > 0 for all k and


∞ ∞ ∞
X X
k−1
X p
pX (k) = p q =p qk = =1
k=1 k=1 k=0
1−q

since 0 < q < 1.


(b) The probability mass function for Z is
Z k Z k
P (Z = k) = P (k − 1 < Y < k) = fY (y) dy = λ exp(−λy) dy
k−1 k−1
−λk
= [− exp(−λy)]kk−1 = −e + e−λ(k−1) = e −λ(k−1)
(1 − e−λ ).
Therefore if p = 1 − exp(−λ) then q = exp(−λ) and P (Z = k) = q k−1 p which is
the same as the distribution in (a).

1
3. (a) Let Z = (Z1 , Z2 )T = DX where
 
1 c 0
D= .
1 0 1

So Z ∼ N2 (Dµ, DΣD T ) where


    
  2 1 1 1 1   1 1
1 c 0  2 + c 1 + 3c 1 + 2c 
DΣD T = 1 3 2  c 0 = c 0
1 0 1 3 3 5
1 2 4 0 1 0 1
2 + 2c + 3c2 3 + 3c
 
= .
3 + 3c 8
For Z1 and Z2 to be independent we require Cov(Z1 , Z2 ) = 0, i.e. 3 + 3c = 0 so
c = −1.
(b) Now Dµ = (−1, 4)T so
     
Z1 −1 3 0
∼ N2 , .
Z2 4 0 8

(c) Let Y = Z1 − Z2 and let Z be a standard normal random variable. Now


Y ∼ N (−5, 11), so P (Z1 > Z2 ) = P (Y > 0) = P Z > √511 = 0.066 from
tables.

4. (a) The moment generating function for t 6= 0 is


b b
etx etx etb − eta
Z 
tx
MX (t) = E(e ) = dx = = .
a b−a t(b − a) a t(b − a)
Rb 1
For t = 0, MX (0) = E(e0 ) = a b−a
dx = 1.
(b) The first and second moments of X are given by MX′ (0) and MX′′ (0) but the
moment generating function is not differentiable at zero.
(c)
b b
xk xk+1 bk+1 − ak+1
Z 
k
E(X ) = = = .
a b−a (k + 1)(b − a) a (k + 1)(b − a)
b − a2
2
b+a b 3 − a3 b2 + ab + a2
Therefore E(X) = = , E(X 2 ) = = and
2(b − a) 2 3(b − a) 3

2 b2 + ab + a2 b2 + 2ab + a2
2 (b − a)2
Var(X) = E(X ) − E(X) = − = .
3 4 12

2
5. (a) The likelihood function is
(
−(θ+1)
θn anθ ni=1 xi
Q
min1≤i≤n xi > a
L(θ|a) = f (X1 , . . . , Xn |θ, a) = .
0 otherwise.

For any θ, L(θ, a) increases as a increases on the interval (0, min xi ) and L(θ, a) =
0 for any a > min xi . Therefore, the MLE for a is

â = min xi .
1≤i≤n
P
The log-likelihood is l(θ, a) = n log θ +nθ log a−(θ +1) log xi . At a stationary
point,
∂l(θ, a) n X
= + n log a − log xi = 0.
∂θ θ
∂ 2 l(θ, a)
Therefore θ̂ = n( log xi − n log â)−1 . The second derivative is
P
=
∂θ2
n
− 2 < 0 so θ̂ is the MLE.
θ
(b) From the form of the likelihood function we can observe that ni=1 xi is a suffi-
Q
cient statistic.
1 np 1
6. (a) Clearly E(p̂) = E(y) = = p so p̂ is unbiased. Also Var(p̂) = 2 Var(y) =
n n n
np(1 − p) p(1 − p)
= . The log-likelihood and its derivatives are
n2 n
 
n
l(p) = log + y log p + (n − y) log(1 − p),
y
∂l y n−y ∂ 2l y n−y
= − , 2
=− 2 − .
∂p p 1−p ∂p p (1 − p)2
∂2l
 
np n − np n
Therefore Fisher’s information is I(p) = E − 2 = 2 + 2
= .
∂p p (1 − p) p(1 − p)
Hence Var(p̂) = I(p)−1 so p̂ is a MVUE.
(b) From above, the asympototic normality of MLEs implies
 
p(1 − p)
p̂ → N p, .
n

(c) From therasymptotic distribution, an approximate 95% confidence interval is


p̂(1 − p̂)
p̂ ± z0.025 , where p̂ = 348/580 = 0.6, z0.025 = 1.96 and n = 580, i.e.
n
0.6 ± 0.04 = (0.56, 0.64).

3
x̄ − µ0
7. (a) The lecturer is proved correct if √ > z0.05 , i.e.,
σ/ n
σ 12
x̄ > µ0 + z0.05 √ = 72 + 1.645 √ = 75.29.
n 36
(b) The probability of a type II error is
   
75.29 − µ1 75.29 − 78
P (X̄ < 75.29|µ1 = 78) = P Z < √ =P Z< √
σ/ n 12/ 36
= P (Z < −1.355) = 0.0877,
where Z ∼ N (0, 1).
(c) We have assumed that the marks are a random sample from a normal distribu-
tion.
s21
8. (a) Test H0 : σ12 = σ22 vs. H1 : σ12 6= σ22 . The test statistic is F = = 0.75. We
s22
reject H0 if F > F8,15,0.975 = 3.20 or if F < F8,15,0.025 = 0.244. Therefore, there
is no evidence to reject the null hypothesis.
(b) Test H0 : µ1 = µ2 vs. H1 : µ1 6= µ2 . The pooled variance is
(n1 − 1)s21 + (n2 − 1)s22 21
s2p = = .
n1 + n2 − 2 23
The test statistic is
x̄1 − x̄2 2 − 3.2
T =r   = q 21 1  = −3.014.
1
1
s2p n1 + n2 1
23 9
+ 16

Now T ∼ tn1 +n2 −2 and from tables, P (t23 > 2.807) = 0.005, P (t23 > 3.485) =
0.001. Therefore, for this two sided test, the p-value is 0.002 < p < 0.01. There
is strong evidence to reject the null hypothesis.
9. (a) The posterior distribution is
P P
π(α|x) ∝ L(x|α)π(α) ∝ αnk e−α xi
λe−αλ = α(nk+1)−1 e−α( xi +λ)

which
P is proportional to a Gamma density. Therefore π(α|x) ∼ Gamma(nk +
1, xi + λ).
nk + 1 nk + 1
(b) The posterior expectation is P and the posterior variance is P
xi + λ ( xi + λ)2
using standard properties of the Gamma distribution.
(c) Using the observed information, the mean and variance of the asymptotic dis-
k kn α̂2 k kn
tribution are α̂ = = P and = 2
= P 2 . Therefore, if λ is small
x̄ xi kn nx̄ ( xi )
and n is large, the first two central moments are approximately equivalent.

4
10. (a) The assumptions of least squares linear regression are E(ǫi ) = 0, Var(ǫi ) = σ 2
and Cov(ǫi , ǫj ) = 0 for all i, j.
(b) We minimise D = ni=1 (Yi − β1 Xi )2 =
P 2
Yi − 2β1 Xi Yi + β12 XP
P P P 2
i . At a
∂D P P 2 Xi Yi
stationary point, = −2 Xi Yi + 2β1 Xi = 0. Therefore β̂1 = P 2 .
∂β1 Xi
2
∂ D
= 2 Xi2 > 0 so β̂1 is the least squares estimator
P
The second derivative is 2
∂β1
of β1 .
β1 Xi2
P P
Xi E(Yi )
(c) The estimator is unbiased since E(β̂1 ) = P 2 = P 2 = β1 . Also,
Xi Xi
 P 2
σ 2 Xi2 σ2
P P
Xi Yi Xi Var(Yi )
Var(β̂1 ) = Var P 2 = P 2 2 = P 2 2 = P 2.
Xi ( Xi ) ( Xi ) Xi

Xi2 increases
P
Therefore, as β̂1 is unbiased and Var(β̂1 ) → 0 as n → ∞ (since
with n), then β̂1 is consistent.

11. (a) The model explains 40% of the variability observed in the response variable.
(b) The completed ANOVA table is
Source Df Sum Sq Mean Sq
Regression 2 9.6 4.800
Residual 17 14.4 0.847
Total 19 24.0
(c) Test H0 : β1 = β2 = 0 vs. H1 : βi 6= 0 for some i. The test statistic is
4.800 17
F = = . We reject H0 if F > F2,17,0.05 = 3.59. Therefore, we conclude
0.847 3
that there is evidence of regression.

12. (a) The first figure shows that the variance of the residuals is increasing (i.e. not
constant) so the assumptions of the model are not satisfied. The second figure
shows the residuals do not follow a normal distribution. Therefore hypothe-
sis tests based on this assumption are not valid. A log transformation of the
response variable might be required.
(b) The missing numbers are 0.40773, −0.235 and 97. X2 should be included in the
model since a test of H0 : β2 = 0 vs. H1 : β2 6= 0 would reject the null hypothesis
since P (|t97 | > 3.234) < 0.002.
(c) A 95% confidence interval for β2 is β̂2 ± t97,0.025 SE(β̂2 ) = 1.46746 ± 1.985 ×
0.45379 = (0.567, 2.367).

You might also like