Tutorial 6 So LN
Tutorial 6 So LN
Tutorial 6 So LN
a
= 0.95,
Pr 0 < <
X
or, equivalently,
a
= 0.95,
Pr X <
,
MX (t) =
t
and the m.g.f. of the sample mean, X, is:
n
=
=
,
t/n
n t
which is the m.g.f. of a Gamma(n, n). Therefore,
1
= 2 (2n) ,
2nX Gamma n,
2
which is therefore free of the parameter . Thus, using this as a pivot, we have:
Pr 2nX < 21 (2n) = 1 ,
or, equivalently,
21 (2n)
= 1 .
Pr <
2nX
20.95 (2n)
,
2n
where 20.95 (2n) denotes the 95th quantile of a chi-squared distribution with 2n degrees of freedom.
2. Let X1 , . . . , Xn be a random sample from N , 2 , and Zk a standard normally distributed. If is
known, then it is known that:
2
Xk
= Zk2 2 (1) ,
so that:
2
n
X
Xk
k=1
n
X
k=1
Zk2 2 (n) ,
and to construct a 100 (1 ) % confidence interval for 2 , we define 2/2 (n) and 21/2 (n) to be the
th
th
(/2) and (1 /2) quantiles respectively of a chi-squared distribution with n degrees of freedom.
Using the above as a pivot quantity, we have:
!
Pn
2
2
2
k=1 (Xk )
< 1/2 (n) = 1 ,
Pr /2 (n) <
2
c Katja Ignatieva
Page 1 of 12
Solutions Week 6
Pn
2
k=1 (Xk )
21/2 (n)
< <
Pn
k=1 (Xk
2/2 (n)
= 1 .
<
.
21/2 (n)
2/2 (n)
3. We have a random sample from a continuous distribution.
(a) To prove that the c.d.f., when viewed as a random variable, has a uniform distribution, we have:
1
Pr (FX (X) x) = Pr X FX
(x)
1
(x) = x.
= FX FX
We know that this is the c.d.f. of a Uniform(0, 1) random variable, because x represents probability, which lays between 0 and 1 and the p.d.f. of the probability is uniformly distributed (e.g.
the probability of the probability occurring is equal for all probabilities between 0 and 1).
FW (x)
= ex ,
x
(c) Let Wk = log (1/FX (Xk )) Exp(1). Then, the m.g.f. of Wk , with = 1 is given by:
MWk (t) =
1
t
1
Using the m.g.f. technique we have, using the properties of m.g.f. (week 1):
Y =
n
X
Wk
k=1
n
t
MY (t) =MW1 +...+Wn (t) = (MWk (t)) = 1
Y Gamma (n, 1) .
n
n
X
Wk
k=1
n
2t
=
M2Y (t) =MW1 +...+Wn (2t) = (MWk (2t)) = 1
n
X
2n 1
2Y 2
Wk Gamma
= 2 (2n) .
,
2 2
n
! 2n
2
k=1
c Katja Ignatieva
Pn
k=1
Page 2 of 12
Solutions Week 6
.
MXi (t) =
t
(a) Use the MGF technique. We have that the m.g.f. of the sample mean X can be written as:
MX (t) =MPni=1 Xi /n (t) = MPni=1 Xi (t/n) = (MXi (t/n))
3n
3n
n
=
=
,
t/n
n t
which is the m.g.f. of a 2 (6n). Thus, we can use it as a pivot to construct confidence interval.
To construct a lower 95% confidence interval for , we note:
Pr 0 < 2nX < 20.95 (6n) = 0.95,
so that equivalently:
Therefore:
2 (6n)
= 0.95.
Pr 0 < < 0.95
2nX
20.95 (6n)
0,
=U ,
2nX
so that equivalently:
Pr 20.05 (6n) < 2nX < = 0.95,
Pr
and, hence:
20.05 (6n)
< < = 0.95,
2nX
2 (6n)
L = 0.05
, ,
2nX
provides an upper confidence interval.
(d) Similar to (b) and (c) above, the following:
2
0.025 (6n) 20.975 (6n)
,
,
2nX
2nX
provides the required confidence interval.
P20
(e) Using k=1 xk = 98.2, we have the following 95% confidence intervals for :
2 (120)
146.57
Lower Tail:
0, 0.95
= 0,
= (0, 0.7463)
2 (98.2)
196.4
Upper Tail:
Both Tails:
95.70
20.05 (120)
, =
, = (0.4873, )
2 (98.2)
196.4
20.025 (120) 20.975 (120)
,
2 (98.2)
2 (98.2)
91.58 152.21
,
196.4 196.4
= (0.4663, 0.7750) .
Note: the values 20.95 (120) = 146.57, 20.05 (120) = 95.70, 20.975 (120) = 152.21, and 20.025 (120) =
91.58 are computed using R or Excel (using: =chiinv(q,df)). Formulae and Tables only provides
percentage points of the chi-squared distribution until 100 degrees of freedom (page 169).
Alternatively: use the approximate
P distribution of a chi-squared distributed for large n. Let
Y 2 (n), then we know Y = ni=1 Zi2 , where Zi are i.i.d. standard normal random variables.
Applying the Law of Large
Numbers (see week 5) we have: Y N (n, 2n). Using this we
have that 2 (n) = n + 2nz , thus: 20.95 (120) 145.49 (z0.95 = 1.6449), 20.05 (120) 94.52
(z0.05 = 1.6449), 20.975 (120) 150.36 (z0.975 = 1.96), and 20.025 (120) 89.64 (z0.025 = 1.96).
c Katja Ignatieva
Page 3 of 12
Solutions Week 6
A negative difference will mean a weight loss and a positive difference, a gain in loss. The sample mean
and standard deviation of the difference is
v
!
u
n
X
u 1
2
2
t
xi n x
= 5.1988.
d = 6.4444
and
sD =
n1
i=1
The required 95% confidence interval is therefore given by:
.
d t1/2,n1 sD
n
= 6.4444 (2.306) 5.1988
9
= (10.44056322, 2.448236783).
1. We have that the difference in sample mean, given known population variances, is given by:
2
2
(X 1 X 2 ) N 1 2 , 1 + 2 ,
n1
n2
note that the samples are independent, thus Cov(X 1 , X 2 ) = 0.
The pivotal quantity is then:
(X 1 X 2 ) (1 2 )
q 2
N (0, 1) .
22
1
+
n1
n2
Finally, using the pivotal quantity we have that the 95% confidence interval is given by:
s
s
22
2
12
12
+
z10.025 < (1 2 ) < (x1 x2 ) +
+ 2 z10.025 ,
(x1 x2 )
n1
n2
n1
n2
where z10.025 is the 0.975 quantile of a standard normal random variable.
2. Now, we have that the difference in sample mean, given equal, but unknown population
variance, is given by:
(X 1 X 2 )(1 2 )
1/n1 +1/n2
r
.
kSp2
k
2
tk =
2
1
where Sp = 1 n1 +n
2 2
pivotal quantity is given by:
Z
=p
,
Y /k
1/n1 +1/n2
Sp2
2
tk .
(n1 1)S12
12
2 (n1 1) and
(n2 1)S22
22
c Katja Ignatieva
Yk
,
Yl
Page 4 of 12
Solutions Week 6
where Yk 2 (n1 1), hence k = n1 1 and Yl 2 (n2 1), hence l = n2 1. The pivotal
quantity is given by:
Fk,l =
22 S12
.
12 S22
< 12 < 21
,
2
s2 F0.95 (n1 1, n2 1)
2
s2 F0.05 (n1 1, n2 1)
(c)
1. We use here the t-distribution, because n1 = 10 and n2 = 10, hence, we do not have a large
sample and cannot use that tn N (0, 1) as n . We have S12 = (1.22)2 = 1.4884 and
(n 1)S12 +(n2 1)S22
= (101)1.4884+(101)0.9216
= 1.205.
S22 = (0.96)2 = 0.9216, hence Sp = 1 n1 n
10+102
2 2
Thus, the 95% confidence interval is given by:
r
r
1
1
1
1
(x1 x2 ) t10.025,k sp
+
<(1 2 ) < (x1 x2 ) + t10.025,k sp
+
n1
n2
n1
n2
r
r
2
2
<(1 2 ) < (2.83) + t10.025,18 1.205
(2.83) t10.025,18 1.205
10
10
1.798582315 <(1 2 ) < 3.861417685,
using t10.025,18 = 2.101 (see table Formulae and Tables page 163). Note, when n
t10.025,n = z10.025 = 1.96, we see that the small sample size makes a difference.
2. The 90% confidence interval for the ratio of the population variance is given by:
s21
1
s21
1
12
<
<
s22 F0.95 (n1 1, n2 1) 22
s22 F0.05 (n1 1, n2 1)
1.4884
1.4884
1
2
< 12 <
3.179
0.9216 3.179 2
0.9216
2
0.508027 < 12 < 5.13414
2
1
using F0.05 (9, 9) = F0.951(9,9) = 3.179
and F0.95 (9, 9) = 3.179 (see table Formulae and Tables
page 172).
We have that one is in the 90% confidence interval for the ratio of the variance, thus we
cannot reject that the variance of the samples is equal with probability 90%. Therefore, the
assumption of equal variances is a good assumption.
7. (See Q9 before doing this) X, the number of customers who indicated high satisfaction; X Binomial(200, p).
X
172
43
= 200
Estimator of the parameter p : pb =
= 50
= 0.86. Then:
n
Z= r
0.86 p
0.86 (1 0.86)
200
N (0, 1).
c Katja Ignatieva
Page 5 of 12
(a) Let X =
Solutions Week 6
Xi
i=1
2
X N (, X
= 2 /n).
,
X z1/2 , X + z1/2
n
n
is an approximate 100 (1 ) % confidence interval for . Hence the width of a 95% confidence
interval for is 2z10.025 n . For this problem,
width = 2(1.96)
(b) We want:
120
= 47. 04.
10
2z10.025 10,
n
hence:
120
2(1.96) 10,
n
2
= 2212. 761 6. The minimum sample size required is 2213.
and n 2(1.96) 120
10
(c) The smaller the width of the confidence interval, the larger is the required sample size.
9. (a) A random variable Y has a Poisson distribution with parameter but there is a restriction that
zero counts cannot occur. The distribution of Y in this case is referred to as the zero-truncated
Poisson distribution.
1. Let X be the not-truncated random variable of Y . Hence, X has a Poisson distribution. Note
that:
Pr(X = x)
Pr(Y = y) = Pr(X = x|X > 0) =
Pr(X 1)
Pr(X)
=
1 Pr(X = 0)
=
and zero otherwise.
y e
,
y!(1 e )
for y = 1, 2, 3, . . . ,
2.
E[Y ] = E[X|X > 0] =
=
=
=
=
* using
y=0
y e
(y)!
yy e
y!(1 e )
y=1
X
1
y e
1 e y=1 (y 1)!
X
y+1 e
1
1 e y=0 (y)!
y e
1 e y=0 (y)!
1 e
is the sum of all the probability mass function of a Poisson random variable
c Katja Ignatieva
Page 6 of 12
Solutions Week 6
=
1 Pr(X = 0)
=
,
1 e
E[X|X > 0] =
L(; y) =
n
Y
fY (yi ) =
i=1
i=1
; y =
n
X
i=1
n
Y
yi
n
P
e
=
n
yi !(1 e )
(1 e )n Q
yi
i=1
,
yi !
i=1
n
X
)+
i=1
yi ln ln
n
Y
i=1
yi ! .
To find the maximum point, we set the derivative of the log-likelihood function equal to zero:
(; y)
ne
= n
+
d
(1 e )
n
P
yi
i=1
= 0.
Equivalently,
1
or:
e
Y
+
= 0,
(1 e )
Y
Also, from the method of moments:
e
= 0.
1 e
=0
1 e
e + e
0 =Y
1 e
e
,
0 =Y
1 e
Y =E [Y ] =
* using result in Q9(a)2. Hence the maximum likelihood estimate is the same as the method
of moments estimate.
c Katja Ignatieva
Page 7 of 12
Solutions Week 6
2.
(; y)
ne
=n
+
(1 e )
2 (; y)
=
2
n
P
yi
i=1
(1 e )ne ne
(1 e )2
n
P
yi
ne
i=1
=
(1 e )2
2
n
P
"
#
y
i
2 (; y)
ne
i=1
E
=E
(1 e )2
2
2
=
=
=
=
ne
(1 e )2
ne
(1 e )2
n
P
yi
i=1
2
n 1e
2
n
(1 e )
ne n(1 e )
(1 e )2
ne n + ne )
(1 e )2
CRLB =
(1 e )2
ne n + ne )
Pn
i=1
n
Y
i=1
n
X
i=1
and than the the derivative of (p, x) with respect to p and equate that equal to zero:
nX
(p, x) X
=
p
p
1p
(n X)p
(1 p)X
=0
p(1 p)
p(1 p)
(1 p)X =(n X)p
0=
(b)
X =np
pb =X/n.
V ar(T )
c Katja Ignatieva
1
nIf (p)
Page 8 of 12
Solutions Week 6
where
2 #
log(f (x, p))
If (p) =E
p
2
log(f (x, p))
=E
p2
2
log(px (1 p)1x )
=E
p2
2
x log(p) + (1 x) log(1 p)
=E
p2
x/p (1 x)/(1 p)
=E
p
x (1 x)
=E
p2
(1 p)2
(1 p)
p
+
=
p2
(1 p)2
1
1
1
=
=
,
p 1p
p(1 p)
"
p(1 p)
.
n
p(1 p)
.
n
(c) We have:
pb p
1.96 < p
<1.96
p (1 p)/n
pb p
<1.96
p
p (1 p)/n
2
(b
p p)
<1.962
p (1 p)/n
pb2 + p2 2 pb p <1.962
<p <
2
2 (1 + 1.96 /n)
2 (1 + 1.962 /n)
p
(2 pb + 1.962 /n)2 4 (1 + 1.962 /n) pb2
(2 pb + 1.962/n)
+
,
2 (1 + 1.962 /n)
2 (1 + 1.962 /n)
p (1 p)
n
where the last step is derived using the abc-formula: ax2 + bx + c = 0 d = b2 4ac, x =
b d
2a .
(d) Using pb(1 pb) p(1 p) as n we can approximate the approximated pivotal quantity by:
pb p
p
N (0, 1).
pb (1 pb)/n
c Katja Ignatieva
Page 9 of 12
Solutions Week 6
1. We have n = 10, X = 4 and pb = X/n = 0.4. Using this the confidence interval in c) is given
by (0.168177581, 0.687330453) and in d) by (0.096358106, 0.703641894).
2. We have n = 200, X = 80 and pb = X/n = 0.4. Using this the confidence interval in c) is
given by (0.33460464, 0.469164561) and in d) by (0.332103608, 0.467896392).
p
We observe that for large n indeed the convergence pb(1 pb) p(1 p) is is a good approximation,
but for small n (i.e., equal to 10) this does not hold. Therefore, the approximation of the confidence
interval in d) is substantial different than the confidence interval in c).
Note that we use in cases the law of large numbers for the pivotal quantity. The Law of Large
Number is a good approximation if we have a large sum, which is not the case for n = 10.
Therefore, it would be better to use the exact binomial test if n is small and not the normal
approximation. Hence, if n is large, both the Law of Large Numbers and the convergence pb(1
p
pb) p(1 p) can be used for a good approximation of the confidence interval for p, but if n is
small, one should use the exact Binomial pivotal quantity.
11. Note that the sample size is equal to 16 (i.e., n = 16), thus we have a small sample size and have to
use the student-t distribution for the population mean. The 95% (i.e., = 0.05) confidence interval
for the population mean is given by:
s
s
x t1/2,n1 < < x t1/2,n1
n
n
s
s
P16
P16
P16 2
P16 2
2
2
x
x
x
x
1
1
i
i=1 i
i=1 i
i=1 xi n x
t1/2,n1
c Katja Ignatieva
Page 10 of 12
Solutions Week 6
1.1 (n 1) (n 1)
S 2 / 2 (n 1) (n 1)
p
p
>
= Pr
2(n 1)
2(n 1)
!
0.1 (n 1)
= Pr Z > p
2(n 1)
!
n1
=1 0.1 p
2(n 1)
100
=1 0.1
200
1
= 1 0.76025 = 0.23975.
=1
2
13. We have that Xi POI() i.i.d. for i = 1, . . . , 500. Using the moment generating technique we
500
(t) = MX
have MP500
(t) = exp( (exp(t) 1))500 = exp(500 (exp(t) 1)). Thus we have
i
i=1 Xi
P500
i=1 Xi = X POI(500).
P500
Due to the Law of Large numbers, we have that i=1 Xi = X is approximately normally distributed
with mean 500 and variance 500. Thus:
X
500 N (0, 1).
500
We have:
83
500 < z0.975
500
1.96 <
< 1.96
83
<1.96
500
500
832
83
500 <1.962
+ 500 2 2
500
500
2
83
83
500 + 1.962 ) <0
+ 500 2 (2
500
500
0.133923 < < 0.205761,
z0.025 <
where the last step is derived using the abc-formula, i.e., ax2 + bx + c = 0 d = b2 4ac, x =
b d
2a .
FX x(n) =
0,
x(n) n
1,
if x(n) < 0;
, if 0 x(n) ;
if x(n) > .
if u < 0;
0,
n
(u) , if 0 u 1;
FU (u) =
1,
if u > 1.
c Katja Ignatieva
Page 11 of 12
Solutions Week 6
(b) We use U as a pivotal quantity. To find the confidence interval for we have:
Pr (q1 ) =0.95
Pr q1 X(n) /U =0.95
q1
1/U =0.95
Pr
X(n)
X(n)
=0.95
Pr U
q1
X(n)
FU
=0.95
q1
X(n) n
=0.95
q1
X(n)
=0.951/n
q1
q1 =X(n) 0.951/n
Pr X(n) 0.951/n =0.95,
* using U = (1/)X(n) = X(n) /U . Thus, the 95% lower confidence interval for is (0, X(n)
0.951/n ).
-End of Week 6 Tutorial Solutions-
c Katja Ignatieva
Page 12 of 12