Академический Документы
Профессиональный Документы
Культура Документы
Interval Estimation
3.1 Introduction
In this chapter we move away from inference based upon the use of a single estimate of an
unknown population quantity, focusing instead upon interval estimation, or also known as
set estimation.
An estimator is a statistic and therefore a random variable and it will have a probability
distribution function. In this respect the use of a single statistic as a point estimate ignores
the inherent variation in the random variable. In addition, for continuous variables the
probability that a random variable assumes a single value is zero.
Instead of choosing one plausible point, one may try to determine a plausible subset of
the parameter space . This is called set estimation (or interval estimation, in the
case that IR).
109
110 CHAPTER 3. INTERVAL ESTIMATION
Note
Sometimes, particularly in discrete models, we cannot find a region for which this proba-
bility is exactly 1 , for a given preassigned . If so, we try to have at least 1 and
as close as possible to 1 :
P ( D(X1 , . . . , Xn )) 1 , for all .
The general idea from the introduction becomes simple in the case of a single real pa-
rameter IR. In this case, a confidence region D(x1 , . . . , xn ) is typically of the
form
[l(x1 , . . . , xn ), r(x1 , . . . , xn )]
i.e. an interval with l(x1 , . . . , xn ) and r(x1 , . . . , xn ) in . The functions l and r will be
such that, for a sample X1 , . . . , Xn : l(X1 , . . . , Xn ) and r(X1 , . . . , Xn ) are statistics.
Definition
P [ < 2nX/22n; ] = 1
Pivotal Quantity
Let X1 , . . . Xn denote a random sample with common density fX (; ). Let Q = q(X1 , . . . , Xn ; ).
If Q has a distribution that does not depend on , Q is a pivotal quantity.
If Q = q(x; ) is a pivotal quantity with known probability density function, then for any
fixed 0 < (1 ) < 1 ,there exists q1 , q2 depending on (1 ) such that
P [q1 < t(x1 , ..., xn ) < q2 ] = 1
If for each sample realization (x1 , . . . , xn )
q1 < Q(x
;
) < q2
iff functions t1 (x1 , . . . , xn ) < < t2 (x1 , . . . , xn ) for functions t1 and t2 , then (T1 , T2 )is a
100(1 )%confidence interval for .
112 CHAPTER 3. INTERVAL ESTIMATION
Note:
As mentioned above for any fixed (1 ) there are many possible pairs of numbers q1 and
q2 that can be selected so that P (q1 < Q < q2 ) = 1 .
How does CI2 compares to CI1 ? Obviously CI1 is superior to CI2 , since the length of
CI1 = 2.36 is less than the length of CI2 = 2.63.
We want to select q1 and q2 that will make t1 and t2 close together. This can be achieved
by selecting q1 and q2 such that the length of the interval is the shortest, or the average
length of the random interval the smallest. Such an interval is desirable since it is more
informative. We have to note also that shortest-length confidence intervals do not always
exist.
For the previous example, the length of the confidence interval is given by
[X q1 (/ n)] [X q2 (/ n)] = (q2 q1 )(/ n)
We have to select q1 and q2 , such that (q2 q1 ) is minimum under the restriction that
P (q1 < Q < q2 ) = 1 . This is true if q1 = q2 . Such an interval is a 100(1 )%
shortest-length confidence interval based on Q.
3.3. CONFIDENCE INTERVAL FOR THE PARAMETERS OF A NORMAL POPULATION113
Note: For some problems, the equal tailed choice of q and q will provide the minimum
expected length, but for others it will not.
n
1 P
A natural estimator for is the ML-estimator X = n Xi . We have, by the central limit
i=1
theorem,
X
q N (0; 1).
2
n
114 CHAPTER 3. INTERVAL ESTIMATION
(a) (a) = 1
or 2[1 (a)] =
or (a) = 1
2
1
or a = 1 z1 2 (notation)
2
N(0;1) density
a/2
z1-a/2
0
Then we have :
r r !
2 2
P X z1/2 X + z1/2 = 1 .
n n
nS 2
We replace 2 in the previous example by the unbiased estimator n1 . We know :
X
q t(n 1).
S2
n1
As before, we obtain :
r r !
S2 S2
P X tn1;1/2 X + tn1;1/2 =1
n1 n1
3.3. CONFIDENCE INTERVAL FOR THE PARAMETERS OF A NORMAL POPULATION115
t(n-1) density
a/2
0 tn-1; 1-a/2
n
1
The ML-estimator for 2 is (Xi )2 and we know that
P
n
i=1
n
1 X
(Xi )2 2 (n).
2
i=1
or
n n
!
1X 1X
P (Xi )2 2 (Xi )2 = F (b) F (a)
b a
i=1 i=1
where F is the distribution function of a 2 (n) random variable.
In order to obtain a 100(1 )% confidence interval, we have to choose a and b such that
F (b) F (a) = 1
or [1 F (b)] + F (a) =
A possible choice is
1 F (b) = F (a) = 2
a = F 1
2n;/2
i.e. 2
b = F 1 1
2n;1/2
2
116 CHAPTER 3. INTERVAL ESTIMATION
c2 (n) - density
a/2
a/2
n n
" #
1 X
2 1 X
2
(xi ) , (xi ) .
2n;1/2 i=1
2n;/2 i=1
LetX1 , . . . , Xn1 and Y1 , . . . , Yn2 be, respectively two random samples of sizs n1 and n2
from the two normal distributions N (1 ; 12 ) and N (2 ; 22 ).
n2 n1
1 X 1 X
Y = Yi , X = Xi .
n2 n1
i=1 i=1
n1 n2
1 X 1 X
S12 = 2 2
(Xi X) , S2 = (Yi Y )2 .
n1 n2
i=1 i=1
We have
1 1
Y X N (2 1 ; 2 ( + ))
n1 n2
n1 S12
2 (n1 1)
12
n2 S22
2 (n2 1)
22
n1 S12 + n2 S22
2 (n1 + n2 2)
2
n1 S12 + n2 S22
Sp2 = .
n1 + n2 2
Then, we have
Y X(2 1 )
r
2 n1 + n1
Y X (2 1 ) 1 2
s = r 2 +n S 2
t(n1 + n2 2).
n1 S1
1 1 2 2
Sp2 + 2
n1 +n2 2
n1 n2
but unfortunately, this distribution depends on the unknown 12 and 22 for fixed n1 , n2 .
This is known as the Behrens-Fisher problem.
There are several solutions to this problem. One of them is due to Welch
The distribution of T is approximately t( ), where
2 2
s1 s22
n1 1 + n2 1
= 2 2 2 2 .
1 s1 1 s2
n1 1 n1 1 + n2 1 n2 1
If is not an integer, then we take the degrees of freedom equal to the integer nearest to
Now,
S12 S22 2 2
E + = 1 + 2
n1 1 n2 1 n1 n2
S12 S22 214 224
V ar + = +
n1 1 n2 1 (n1 1)n21 (n2 1)n22
2
2
2
E () = . = 2
2
4 4
2
V ar () = 2 .2 = 2
Hence
12 22
= 2
+
n1 n2
14 24 4
+ =
3.3. CONFIDENCE INTERVAL FOR THE PARAMETERS OF A NORMAL POPULATION119
This gives :
2
12 22
+
n1 n2
= 2 2 2 2 .
1 1 1 2
n1 1 + n2 1
n1 n2
n1 s21 n2 s22
The unknown parameters 12 and 22 are now replaced by estimates and .
n1 1 n2 1
This gives :
2
s21 s22
+
n1 1 n2 1
= 2 2 .
2 2
1 s 1 s 2
n1 1 + n211
n1 1 n2 1
Notes
22
Example [Confidence interval for , if 1 and 2 are known]
12
use that
n1
(Xi 1 )2 ,
P
i=1
n1
12
n2 F (n1 , n2 )
)2 ,
P
(Yi 2
i=1
n2
22
120 CHAPTER 3. INTERVAL ESTIMATION
Conclusion : a 100(1 )% confidence interval for the ratio 22 /12 if 1 and 2 are
known is given by
n2 n2
)2 )2
P P
(yi 2 (yi 2
Fn ,n ;/2 n1 i=1 n1 i=1
1 2 n , Fn 1 ,n2 ;1/2 n
.
n2 P1 2 n2 P1 2
(xi 1 ) (xi 1 )
i=1 i=1
22
Example [Confidence interval for , if 1 and 2 are unknown]
12
Use that
n1 S12
(n1 1)
12
F (n1 1, n2 1).
n2 S22
(n 2 1)
22
Conclusion : a 100(1 )% confidence interval for the ratio 22 /12 if 1 and 2 are
unknown is given by
n2 n2
" #
2 2
n2 1 s2 n2 1 s2
Fn1 1,n2 1;/2 n1 2 , Fn1 1,n2 1;1/2 n1 2 .
n1 1 s1 n1 1 s1
Here :
a/2
0 Fn1-1,n2-1;a/2 Fn1-1,n2-1;1-a/2
3.4. OTHER EXAMPLES OF CONFIDENCE INTERVALS 121
Let (X1 , Y1 ), . . . , (Xn , Yn ) be a random sample from bivariate normal distribution with pa-
rameters E(X) = 1 , E(Y ) = 2 , var(X) = 12 , var(Y ) = 22 and correlation coefficient(X, Y ) =
. Assume 12 , 22 and known.
Let Di = Xi Yi for i = 1, 2, . . . , n. Then,
Di N (1 2 , 12 + 22 + 21 2 )
| {z }
2
D
D N (1 2 /n)
2 , D
[D(1 2 )]
D / n
N (0, 1)
Pn
i=1 (Di D)2 /D
2 2 (n 1)
n[D(1 2 )]
D
sP
n (D X)2
t(n 1)
i=1 i
2 (n1)
D
n(n1)[D(1 2 )]
Pn t(n 1)
2
i=1 (Di D)
We can use it as pivotal quantity as the distribution is free of any unknowns.
p
n(n 1)[D (1 2 )]
P q qP q = 1
n 2
i=1 (D i D)
r P )% confidence
Thus, a100(1 r Pinterval for (1 2 ) is
n 2 n 2
i=1 (Di D) i=1 (Di D)
[D q n(n1) ,D + q n(n1) ]
Example
Mn = max(X1 , . . . , Xn )
Mn
and note that the distribution of does not depend on :
122 CHAPTER 3. INTERVAL ESTIMATION
0 . . . if x 0
Mn
P x = xn . . . if 0 x 1
1 . . . if x 1
If
bn an = 1
Mn Mn
then P = 1 .
b a
Example
Hence
n
!
X
P 22n;/2 2 Xi 22n;1/2 =1 .
i=1
Example
Let (X1 , Y1 ), . . . , (Xn , Yn ) be i.i.d. r.v.s from the Beta distribution with = 1 and =
unknown.
ToP construct a 100(1 )% confidence interval we proceed as follows:
ni=1 lnXi is a sufficient statistic for . Consider the transformation Yi = 2lnXi . It
can be easily shown that its p.d.f. is 12 eyi /2 ,yi > 0 which is the probability density function
of 2 (2). This shows that
n
X n
X
Tn = 2 logXi = Yi
i=1 i=1
is distributed as 2 (2n), which shows that Tn is a pivotal quantity. Now find l and r
(l < r) such that
P (l 2 (2n) r) = 1 (3.1)
which give us
n
X
P (l 2 logXi r) = 1
i=1
which is equivalent to
22n; 22n;1
!
P Pn 2 Pn 2 =1
i=1 Yi i=1 Yi
In Bayesian statistics the estimator for a parameter is given by the mean of the posterior
distribution (in the case of squared error loss) or by a median of the posterior distribution
(in the case of absolute error loss).
In the same spirit we can construct a 100(1 )% Bayesian confidence interval for
by finding two functions
i.e. X
P ( = |X1 = x1 , . . . , Xn = xn ) = 1
l(x1 ,...,xn )r(x1 ,...,xn )
or
r(x1Z,...,xn )
f
X
(|x1 , . . . , xn )d = 1
| 1 ,...,Xn
l(x1 ,...,xn )
Example
2 0 + 02 nx 2 02
N ; .
2 + 02 n 2 + n02
Example
Suppose that X = (X1 , . . . , Xn) is a random sample from the Bernoulli distribution with
success parameter p. Moreover, suppose that p has a prior beta distribution with left
parameter a > 0 and right parameter b > 0. Denote the number of successes by
n
X
Y = Xi
i=1
Recall that for a given value of p, Y has the binomial distribution with parameters n and
p.
Given Y = y, the posterior distribution of p is beta with left parameter a + y and right
parameter b + (n y).
A (1 ) level Bayesian confidence interval for p is (l(y), r(y)) , where l(y) is the quantile
of order /2 and r(y) is the quantile of order 1 /2 for the beta distribution (posterior
distribution of p).
3.6. CONFIDENCE REGIONS IN HIGHER DIMENSIONS 125
Example
Suppose that X = (X1 , . . . , Xn ) is a random sample from P oisson(). Moreover, suppose
that has a prior (; ). The postirior distribution is given by
X
1
f
X ,...,X
(|x 1 , . . . , x n ) [(n + 1/) , xi + ]
| 1 n
It follows that
X
2(n + 1/)f
(|x1 , . . . , xn ) 2 [2( xi + )]
X | 1 ,...,Xn
and
P [2v;/2 < 2(n + 1/)f
(|x1 , . . . , xn ) < 2v;1/2 ] = 1
|X1 ,...,Xn
P
where v = 2( xi + ).
Thus, a 100(1 )% Baysesian confidence interval for is given by
2v;/2 2v;1/2
!
,
2(n + 1/) 2(n + 1/)
The notion of confidence intervals can be extended to confidence regions for a general
k-dimensional parameter = (1 , . . . , k ) IRk .
The k-dimensional rectangle
we have
P (Ljn j Rjn ) = 1 j , say.
If the pairs (Ljn , Rjn ), j = 1, . . . , k are independent, then for the rectangle
we have
k
Y
P (Ljn j Rjn ; j = 1, . . . , k) = (1 j ).
j=1
126 CHAPTER 3. INTERVAL ESTIMATION
k
T
If there is no independence, then by Bonferronis inequality (P ( Aj ) 1
j=1
k k
P (Acj )) we only have P (Ljn j Rjn ; j = 1, . . . , k) 1
P P
j .
j=1 j=1
Hence, if j = k for all j = 1, . . . , k, then
P (Ljn j Rjn ; j = 1, . . . , k) 1 .
Example
r r !
S2 S2
P X tn1;1/4 X + tn1;1/4 =1 2
n1 n1
!
nS 2 nS 2
P 2 = 1 2 .
2n1;1/4 2n1;/4
s s
S2 S2 nS 2 nS 2
P X tn1;1/4 X + tn1;1/4 , 2 2
n1 n 1 2n1;1/4 n1;/4
s s
s2 s2
(1 , 2 )|x tn1;1/4 1 x + tn1;1/4 ,
n1 n1
)
ns2 ns2
2
2n1;1/4 2n1;/4
3.6. CONFIDENCE REGIONS IN HIGHER DIMENSIONS 127
q2
n s2
2
cn-1 ;a/4
n s2
2
cn-1;1-a/4
q1
x - tn-1;1- a/4 s2 x x + tn-1;1- a/4 s2
n-1 n-1
A confidence region which is not rectangular can be obtained, using the independence of
X and S 2 .
Indeed, since
X nS 2
N (0; 1) and 2 (n 1)
2
r
2
n
nS 2
X
Pa r a = 1 and P b 2 c = 1 .
2
n
X nS 2
P a r a, b 2
c = 1 . 1 = 1 .
2
n
= (, 2 ) is :
The 100(1 )% confidence region for
a2 22 ns2 ns2
2
(1 , 2 )|(x 1 ) , 2 :
n c b
128 CHAPTER 3. INTERVAL ESTIMATION
q2 q2 = n2 (x - q1)2
a
n s2
b
n s2
c
q1
x
In all the examples considered up to now (except the Behrens-Fisher problem) the con-
struction of a confidence interval followed from the fact that the distribution of some
random variable was exactly known (standard normal, t, 2 , F, . . .). The use of the large
sample limiting distribution (as n ) leads to approximate 100(1 )% confi-
dence intervals.
X d
q N (0, 1) ,n
2
n
X d
q N (0; 1) , n .
S2
n1
Another useful tool in the construction of approximate confidence intervals is the asymp-
totic normality result of the maximum likelihood estimator : for a large sample from
X, with sufficiently regular density f (x; ), we have that the ML-estimator Tn for satisfies
T d
rn N (0; 1) ,n
1
ni()
Example
Hence :
X
P z 1/2 r z 1/2
1
(1 )
n
or
2 2 (1 )
P (X ) z1/2 1
n
or
2
P (1 + 1 z2 )2 (2X + 1 z2 ) +X 0 1
n 1/2 n 1/2
For fixed X (0 X 1)
2 2
(1 + 1 z1/2 )2 (2X + 1 2
z1/2 ) + X
n n
is a quadratic polynomial in with 2 real roots. Hence the above is equivalent to : (with
z z1/2 ) :
q q
z2 z2 z2 z2
nX + 2 z nX(1 X) + 4 nX + 2 +z nX(1 X) + 4
P 1 .
n + z2 n + z2
Example
n
or
2 2
P (X ) z 1 .
n
This leads to :
where z = z1/2 .
The computations needed in the last two examples can be avoided (but lead to a less
1
accurate approximate confidence interval) replacing the asymptotic variance ni() of the
ML-estimator by the estimator
1
.
ni(Tn )
We then construct an approximate confidence interval from the fact that, in most cases :
T d
sn N (0; 1) , n .
1
ni(Tn )
X d
s N (0; 1) , n
X(1 X)
n
" r r #
x(1 x) x(1 x)
xz , x+z .
n n
n
1X 2 2 2
S2 = Xi X = X X = X(1 X),
n
i=1
Example
X d
s N (0; 1) ,n
X
n
" r r #
x x
xz , x+z
n n
Example
n n
1 1
Xi2 Xi2
P P
n n
i=1 i=1 d
s 2 = n
q N (0; 1)
n 1 2
Xi2
P
2 1
Xi2
P
n n
n n i=1
i=1
n n
" r ! ! r ! !#
2 1X 2 2 1X 2
1z xi , 1+z xi .
n n n n
i=1 i=1
The approximate confidence intervals obtained from the asymptotic normality result of
the ML-estimator are not invariant under transformations of the parameter.
Example
n
1/2 n
1/2
1 1
x2i x2i
P P
n n
i=1 i=1
, .
q q
1+z 1 1z 1
2n 2n
n n
1 1
x2i x2i
P P
n n
i=1 i=1
q 2 , q 2
1 1
1+z 2n 1z 2n
r !2 r
1 2 z2
1z =1z + .
2n n 2n
134 CHAPTER 3. INTERVAL ESTIMATION
S(; X) d
p N (0; 1) ,n
ni()
Here
n
X
S(; X
)= lnf (Xi ; )
i=1
2
is the score statistic and i() = E 2 lnf (X; ) .
Let be a strictly increasing function of and let () = .
Then
lnf (X; ) = lnf (X; ). .
Hence :
E lnf (X; ) = 0 E lnf (X; ) = 0 .
Also
2
2 2
lnf (X; ) = 2
lnf (X; )
2
2
+ lnf (X; ). 2 .
Hence :
2 2
2
E lnf (X; ) = E lnf (X; )
2 2
or 2
i() = i( ) .
3.7. APPROXIMATE CONFIDENCE INTERVALS 135
Hence :
S( ; X) S(; X)
p = p .
ni( ) ni()
Example
Then
n
n 1 X 2
S(; X
)= + 3 Xi
i=1
2
i() = 2
Hence :
n n
n 1 X 2 1 X 2
+ 3 Xi Xi n
2 d
r i=1 = i=1
N (0; 1)
2n 2n
2
Notes
This is not the same as in the previous example. But for large n, the difference in
negligible.
If we would have taken 2 as the parameter, then this procedure would have given
P n n
2 2
P
x xi
i=1 i i=1
,
n + z 2n n z 2n
1 1
V = B (Tn)
n
where B(
) is the Fisher information matrix.
It follows that
)V 1 (Tn
(Tn )0
P
((T
n
)V 1 (Tn
)0 c ) 1 .
The question of how large the sample size should be to achieve a given accuracy is a
very practical one. The answer is not easy. The problem is related to confidence interval
estimation. We consider some examples.
1. Take a first sample of fixed size n0 2, and compute the sample mean and the
sample variance :
n0
1 X
X0 = Xi
n0
i=1
n0
1 X
S02 = (Xi X 0 )2 .
n0
i=1
N n0 + 1
and
n0 2
n0 1 S0 2
N tn0 1;1/2
d2
and use as a confidence interval
s s
n0 2 n0 2
X N tn 1;1/2 n0 1 S0 n0 1 S0
0
, X N + tn0 1;1/2
N N
where
N
1 X
XN = Xi
N
i=1
n0
P N
P
Xi + Xi N
i=1 i=n0 +1 n0 1 X
= = X0 + Xi .
N N N
i=n0 +1
Proof
XqN
XN 2
N
P
r x = P
r x
n0 2 n0 S 2
n0 1
S0 0
2
N n0 1
qk
X
X 2
k
= n0 S 2 x , N = k .
P r
0
k 2
n0 1
Since for k n0 + 1 :
k
n0 1 X
Xk = X0 + Xi .
k k
i=n0 +1
we need to have ry yn
n
n
(1 n )
z d.
n
If we use that
yn 1 2 1
yn yn 1
1 =
n n 4 n 2 4
then we obtain r
1
z d
4n
or
z2
n
(2d)2
1
(For = 0.05 : z 2 = (1.96)2
= 4 one sometimes uses n 2 )
d
A similar formula holds if we use the approximate 100(1 )% confidence interval
r
z2 yn (n yn ) z 2
yn + 2 z +
n 4 .
n + z2
To obtain a length of at most 2d, we need to have
r
z yn (n yn ) z 2
+ d
n + z2 n 4
yn (n yn ) n
or, again using that ,
n 4
s
1
z d
4(n + z 2 )
or,
z2
n z2
(2d)2
140 CHAPTER 3. INTERVAL ESTIMATION
The obtained formulas are crude since they rely on the inequality
1
(1 ) (0 1)
4
1
which is only good near = .
2
1 1
It is clear that we can do better if we know a priori that 0 < or 1 > .
2 2
The lower bounds for the required sample size may be very high. This can be a problem
if the size of the population is small.
A way out can be to use the procedure of sampling without replacement.
{x1 , x2 , . . . , xN }
1 1 1
P (X1 = x01 , X2 = x02 , . . . , Xn = x0n ) = ...
N N 1 N n+1
Let us examine some properties of the sample mean X and the sample variance S 2 as
estimators for the population mean and the population variance 2 .
The population mean and population variance are now
N
1 X
= xi
N
i=1
N N
2 1 X 1 X 2
2
= (xi ) = xi 2 .
N N
i=1 i=1
N
1 X
E(Xi ) = xi =
N
i=1
N
1 X 2
V ar(Xi ) = E(Xi2 ) (E(Xi ))2 = x i 2 = 2
N
i=1
j 6= i
N N
1 1 X X
= x i x j 2
N N 1
i=1
j=1
j 6= i
N N
1 1 X X
= xi x j x i 2
N N 1
i=1 j=1
N
!2 N
1 1 X X
= xi x2i 2
N N 1
" i=1 N
i=1
#
1 1 X
= (N )2 x2i 2
N N 1
i=1 #
N
"
1 1 X
= x2i 2
N 1 N
i=1
2
=
N 1
Hence
142 CHAPTER 3. INTERVAL ESTIMATION
n
1X 1
E(X) = E(Xi ) = n =
n n
i=1
n
!
1 X
V ar(X) = V ar Xi
n
i=1
n n n
1 X 1 X X
= V ar(X i ) + Cov(Xi , Xj )
n2 n2
i=1 i=1
j=1
j 6= i
1 2 n(n 1) 2
= n
n2 n2 N 1
2 n1
= 1
n N 1
2 N n 2
= <
n N 1 n
N n
The fraction is called the finite population correction factor. This factor
N 1
n
becomes negligible if N is large and is small (say, n is less than 5% of N ).
N
Indeed : n
N n 1 N
= 1.
N 1 1 N1
n
The quantity is called the sampling fraction.
N
n
!
2 1X 2 2
E(S ) = E Xi X
n
i=1
n
1X 2
= E(Xi2 ) E(X )
n
i=1
n
1X
= [V ar(Xi ) + (E(Xi ))2 ] [V ar(X) + (E(X))2 ]
n
i=1
n 2
1X 2 2 N n 2
= ( + ) +
n n N 1
i=1
1N n n1 N
= 2 1 = 2
nN 1 n N 1
N 1 n
Hence : S 2 is unbiased for 2 .
N n1
3.8. SAMPLE SIZE DETERMINATION 143
To find an approximate confidence interval for the population mean, we use that
X
s is approximately N (0; 1).
2 N n
n N 1
Suppose N is the size of the population and that N1 of them have a certain property S
(and N N1 do not have this property). We want to estimate
N1
=
N
then
n
X
Yn = Xi = the number of observations with propertyS.
i=1
Thus :
r r !
Yn (1 ) N n Yn (1 ) N n
P z . +z . 1 .
n n N 1 n n N 1
144 CHAPTER 3. INTERVAL ESTIMATION
Yn
If we replace under the square root sign by , we obtain :
n
N n
(If N is large and n/N is small then 1 and this interval is like before)
N 1
yn yn 1
Using that 1 , this gives
n n 4
r
1 N n
z . d
4n N 1
or, solving for n :
N
n 2 .
2d
1 + (N 1)
z
N
n .
1 + N d2
3.9. INTERVAL ESTIMATION USING R 145
100
80
60
sample run
40
20
0
2 3 4 5
4
2
0
x = 0
n = 10
alpha1 = 1 / 2
alpha2 = 1 / 2
conf.level = 0.95
alpha = 1 - conf.level
eps = 1e-4
theta = seq(0, 1, eps)
y = dbeta(theta, x + alpha1, n - x + alpha2)
ymax = max(y)
if (! is.finite(ymax)) ymax <- max(
dbeta(0.02, x + alpha1, n - x + alpha2),
dbeta(0.98, x + alpha1, n - x + alpha2))
qlow = round(qlow / eps) * eps
qhig = round(qhig / eps) * eps
plot(theta, y, type = "l", ylim = c(0, ymax),
xlab = "p", ylab = "h(p | x)")
tpoly = seq(qlow, qhig, eps)
xpoly = c(tpoly, qhig, qlow)
ypoly = c(dbeta(tpoly, x + alpha1, n - x + alpha2), 0, 0)
ypoly = pmin(ypoly, par("usr")[4])
polygon(xpoly, ypoly, border = NA, col = "hotpink1")
lines(theta, y)
148 CHAPTER 3. INTERVAL ESTIMATION
> #One sided lower 95% confidence interval for a normal population
# mean with variance=1.5.
> gb=c(5,5,6,7,4,4,3,5,6,5)
> sigma=1.5
> simple.z.test = function(x,sigma,conf.level=0.95) {
+ n = length(gb);xbar=mean(gb)
+ alpha = 1 - conf.level
+ zstar = qnorm(1-alpha)
+ SE = sigma/sqrt(n)
+ xbar - zstar*SE
+ }
> ## now try it
> simple.z.test(x,sigma)
[1] 4.219777
> #One sided upper 95% confidence interval for a normal population mean
# with variance=1.5.
> gb=c(5,5,6,7,4,4,3,5,6,5)
> sigma=1.5
> simple.z.test = function(x,sigma,conf.level=0.95) {
+ n = length(gb);xbar=mean(gb)
+ alpha = 1 - conf.level
+ zstar = qnorm(1-alpha)
+ SE = sigma/sqrt(n)
+ xbar + zstar*SE
+ }
> ## now try it
> simple.z.test(gb,sigma)
[1] 5.780223
3.10 Exercises
4. Suppose that the random variable X has a geometric probability density function
with parameter .
(i) Derive a conservative one-sided lower 100(1 )% confidence limit for based
on a single observation x.
(ii) If x = 5, find a one sided lower 90% confidence limit for .
(iii) If X1 , . . . , Xn is a random sample from a geometric probability density function
with parameter , describe the form of one sided lower 100(1 )% confidence
limit for based on sufficient statistics.
5. Let X1 , . . . , Xn be a random sample from Exp(1/). Suppose that the prior density
of is also Exp(1/), where is known. Then,
, where > 0.
152 CHAPTER 3. INTERVAL ESTIMATION
(i) Find a pivotal quantity, and use it to find a confidence- interval estimator of .
(ii) Show that (Y /2, Y ) is a confidence interval. Find the confidence cofficent.
8. LetX1 , . . . , Xn be a random sample from fX (x; ) = I(1/2,+1/2) (x). Let Y1 < . . . <
Yn be the corresponding ordered sample. Show that (Y1 , Yn ) is a confidence interval
for . Find its confidence cofficient.
11. Consider a random sample of size n from U (0, ) > 0, and let Yn be the largest
order statistic.
(i) Find the probability that the random interval (Yn , 2Yn ) contains .
(ii) Find the constant c such that (yn , cyn ) is a 100(1 )%CI for .
12. LetX1 , . . . , Xn be a random sample from a beta(, 1) p.d.f. and assume that has
a gamma(, ) prior p.d.f. Find a 1 Bayes interval set for .
(i) If 2 is known, find a minimum value for n to guarantee that a 0.95 confidence
interval for will have length no more than /4.
(ii) If 2 is unknown, find a minimum value for n to guarantee, with probability
0.90, that a 0.95 confidence interval for will have length no more than /4.
14. If X1 and X2 are independent random variables having, respectively, binomial dis-
tributions with the parameters n1 and 1 and the parameters n2 and 2 , construct a
1 large sample confidence interval for 1 2 . (Hint: Approximate the distribution
of X1 /n1 X2 /n2 with a normal distribution.)
15. Let Y denote the sum of of the items of a random sample of size n from a distribution
which is B(1, ) Assume that the unknown is a value of a random variable which
has a beta distribution with parameters and .
(i) (X, 2X) is a confidence interval for 1/. What is the confidence coefficient?
(ii) Find another confidence interval for 1/ that has the same coefficient but smaller
expected length.
3.10. EXERCISES 153
17. Let X1 , X2 be a random sample of size 2 from N (; 1). Let Y1 < Y2 be the corre-
sponding order sample.
(i) Determine in P [Y1 < < Y2 ] = . Find the expected length of the interval
(Y1 , Y2 ).
(ii) Find the confidence interval estimator for using x as a pivotal quantity
that has a confidence coefficent and compare the length with the expected
length in part(i).
18. X1 , . . . , Xn is a random sample from (1/)x(1)/ I[0,1] (x), where > 0. Find the
100(1 )% CI for . Find the expected length. Find the limiting expected length
of your confidence interval. Find n such that P [length ] for fixed and .
(You may use the central limit theorem).
19. Develop a method for estimating the parameter of the Poisson distribution by a
confidence interval.
20. Let X1 , . . . , Xn be a random sample from f (x/) = x1 I(0,1) (x), where > 0.
Assume that the prior distribution of is given by
r r1 e
f () = I(0,) ()
(r)