Академический Документы
Профессиональный Документы
Культура Документы
1 Hypotheses
A hypothesis is a statement about a population parameter. Often, there are
two complementary statements/hypotheses about θ, respectively called the
null hypothesis and alternative hypothesis.
H0 : θ ∈ Θ0
vs H1 : θ ∈ Θc0 .
Note Θ = Θ0 ∪ Θc0 .
Example 1:
An ideal manufacturing process requires that all products are non-defective.
This is very seldom. The goal is to keep the proportion of defective items
as low as possible. Let p be the proportion of defective items, and 0.01 be
the maximum acceptable proportion of defective items.
statement 1: p ≥ 0.01 (the proportion of defectives is unacceptably high)
statement 2: p < 0.01 (acceptable quality)
Example 2:
Let θ be the average change in a patient’s blood pressure after taking a
drug. An experimenter might be interested in testing
H0 : θ = 0 (the drug has no effect on blood pressure)
H1 : θ = 0 (there is some effect)
91
Rejection region
A hypothesis testing procedure or hypothesis test is a rule that specifies:
i. for which sample values H0 is accepted as true
ii. for which sample values H0 is rejected and H1 is accepted as true.
The subset of the sample space for which H0 will be rejected is denoted as
R and called the rejection or critical region.
The complement set Rc is called the acceptance region.
Example 2: Let X̄ be the average change of blood pressure for the sampled
patients. We are interested in testing
H0 : θ = 0, vs H1 : θ = 0.
92
2 Two Types of Errors
When deciding to accept or reject H0 , we might make a mistake no matter
whatever the decision is:
Type I error: if H0 is true (θ ∈ Θ0 ), but the test incorrectly rejects H0 .
Type II error: if H0 is false (θ ∈ Θc0 ), but the test incorrectly accepts H0
Decision
Truth Accept H0 Reject H0
H0 Correct decision Type I error
H1 Type II error Correct decision
Power Function:
The power function β(θ) of a hypothesis test with rejection region R is
the function of θ defined by
β(θ) = Pθ (X ∈ R) = Pθ (reject H0 )
Prob(committing Type I error) if θ ∈ Θ0
=
1 − Prob(committing Type II error) if θ ∈ Θc0
Therefore,
Prob(committing Type I error) = β(θ), for θ ∈ Θ0
Prob(committing Type II error) = 1 − β(θ), for θ ∈ Θc0 .
Remarks:
• An ideal test should have the power function satisfying:
β(θ) = 0 for all θ ∈ Θ0 ; β(θ) = 1 for all θ ∈ Θc0 .
93
Example: (Binomial power function)
Let X ∼Bin(5, θ). Consider testing
1 1
H0 : θ ≤ versus H1 : θ > .
2 2
Test 1: reject H0 if and only if all “successes” are observed, i.e R = {5}
94
Test 2: reject H0 if X = 3, 4, or 5.
95
3 Likelihood Ratio Tests (LRT)
Let L(θ|x) be the likelihood function of θ. The likelihood ratio test statistic
for testing H0 : θ ∈ Θ0 vs H1 : θ ∈ Θc0 is
supθ∈Θ0 L(θ|x) L(θ̂0 |x)
λ(x) = = ,
supθ∈Θ L(θ|x) L(θ̂|x)
where θ̂0 is the MLE of θ in Θ0 (“restricted” maximization); θ̂ is the MLE
of θ in the full set Θ = Θ0 ∪ Θc0 (“unrestricted” maximization).
Comments:
• The numerator in λ(x) is the maximum probability of the observed
sample x computed over parameters in H0 . The denominator is the
maximum probability of the observed x over all possible parameters.
• θ̂0 is the value in Θ0 which makes the observation of data most likely;
θ̂ is the value in Θ which makes the observation of data most likely.
• If λ(x) is small, it implies that there are some parameter points in
H1 for which the observed sample is much more likely than for any
parameter in H0 . So the LRT suggests we reject H0 and accept H1 .
• The LRT statistic λ(x) is a function of x not a function of θ.
• 0 ≤ λ(x) ≤ 1.
96
Example: (Normal One-sided LRT) X1 , . . . , Xn ∼ iid N (θ, σ 2 ) with θ un-
known and σ 2 known. Consider testing
H0 : θ ≤ θ0 versus H1 : θ > θ0 .
97
Example: Let X1 , . . . , Xn be a random sample from a location-exponential
family
f (x|θ) = e−(x−θ) if x ≥ θ, −∞ < θ < ∞.
Test H0 : θ ≤ θ0 versus H1 : θ > θ0 . Find the LRT and its power function.
98
LRT based on Sufficient Statistics
If T is sufficient for θ, then we can construct the LRT based on T and the
likelihood function L∗ (θ|t) = g(t|θ). Since T (x) contains all the information
about θ in x, the test based on T should be as good as the test based on x.
In fact, the tests are equivalent.
Theorem
If T (X) is a sufficient statistic for θ, λ∗ (t) is the LRT statistic based on
T , and λ(x) is the LRT statistic based on x. Then
λ∗ (T (x)) = λ(x)
99
Example: (Normal Two-sided LRT) X1 , . . . , Xn ∼ iid N (θ, σ 2 ) with σ 2
known. Test
H0 : θ = θ0 versus H1 : θ = θ0 .
Find the LRT and its power function.
100
LRT with Nuisance Parameters
H 0 : θ ≤ θ0 versus H1 : θ > θ0 .
101
4 Unbiased Test
Sometimes we would like a test to be more likely to reject H0 if θ ∈ Θc0 than
if θ ∈ Θ0 , i.e.,
Prob(reject H0 when H0 is false)≥ Prob(reject H0 when H0 is true).
A test with such a property is unbiased. Recall β(θ) = Prob(reject H0 ).
reject H0 if X = 5.
102
Example: (Unbiased test for Normal)
Let X1 , ..., Xn ∼ N (θ, σ 2 ),with σ 2 known. Consider testing
H 0 : θ ≤ θ0 versus H1 : θ > θ0 .
103
5 Controlling Type I error Probability
For a fixed sample size, it is usually impossible to make both types of error
arbitrarily small. It is common to first control Type I error probability at
a specified level, α:
sup β(θ) = α.
θ∈Θ0
sup β(θ) ≤ α.
θ∈Θ0
1 1
Example: Let X ∼Bin(5, θ). Consider testing H0 : θ ≤ 2 vs H1 : θ > 2
with the procedure: reject H0 if X = 5.
104
Remark 1: How to specify H0 and H1 ?
• Remember: Only Type I error probability is controlled in our proce-
dures. If an experimenter expects an experiment to support a partic-
ular hypothesis, but s/he does not wish to make the assertion unless
the data really gives convincing evidence. The test can be set up as
H1 is the one she expects the data to support and hopes to prove.
Remark 2: Generally take the following two steps to construct a good test:
(i) firstly, construct all the level α tests.
(ii) secondly, within this class of tests, we search for the test with Type
II error probability as small as possible; equivalently, we want the test with
the largest power if θ belongs to alternatives.
105
6 Choose c for LRT
Choose c such that Type I error probability of LRT is bounded above by α,
sup P (λ(X) ≤ c) = α.
θ∈Θ0
106
Example: iid N (θ, σ 2 ), σ 2 is known. Consider testing for H0 : θ = θ0 vs
H1 : θ = θ0 . Find the size α LRT test.
107
Example: iid location-exponential dist. Consider testing H0 : θ ≤ θ0 vs
H1 : θ > θ0 . Find the size α LRT test.
108
7 Sample Size Calculation
For fixed n, it is usually impossible to make both types of error probabilities
arbitrarily small. But if we can increase n, it is possible to achieve the
desired power level.
Example: iid N (θ, σ 2 ), σ 2 is known. Test H0 : θ ≤ θ0 vs H1 : θ > θ0 . The
√
LRT test rejects H0 if (X̄ − θ0 )/(σ/ n) > C has the power function
θ0 − θ
β(θ) = 1 − Φ C + √ .
σ/ n
109
Example :
Let X ∼Bin(n, θ). Testing:
reject H0 if X ≤ c.
110
8 Uniformly Most Powerful (UMP) Tests
A good class of hypothesis tests are those with a small probability (say, less
than α) of Type I error; a desired test in such a class would also have a
small Type II error, or, a large power function for θ ∈ Θc0
If we consider
C ={all the level α tests}.
The UMP test in this class is called a UMP level α test. It is the best test
in the class C, or the most powerful level α test.
Interpretation: The power function β(θ) of the UMP level α test satisfies:
β(θ) ≥ β (θ) for θ ∈ Θc0
where maxθ∈Θ0 β(θ) ≤ α
maxθ∈Θ0 β (θ) ≤ α.
Test function:
For each testing procedure, define a test function on the sample space
1 if x ∈ R
φ(x) = .
0 if x ∈ /R
Note φ(x) = I(x ∈ R). The expected value of φ is the power function:
Eθ [φ(X)] = Pθ (X ∈ R) = β(θ).
111
When do UMP tests exist and how to find it?
H 0 : θ = θ0 vs H1 : θ = θ1
Neyman-Pearson Theorem:
Consider testing H0 : θ = θ0 versus H1 : θ = θ1 , where the pdf or pmf
corresponding to θi is f (x|θi ), i = 0, 1, using a test with rejection region R
that satisfies
112
Example: (UMP binomial test)
1
Let X ∼Bin(2,θ). We want to test H0 : θ = 2 versus H1 : θ = 34 .
113
Sufficiency statistic and UMP test
Consider H0 : θ = θ0 vs H1 : θ = θ1 . Suppose T (X) is sufficient for θ
and g(t|θi ) is the pdf or pmf of T corresponding to θi , i = 0, 1. Then any
test based on T with rejection region S is a UMP level α test if it satisfies
114
Example: (UMP normal test for variance)
Let X1 , . . . , Xn be iid from N (0, σ 2 ) with σ 2 unknown. Consider testing
115
9 Monotone Likelihood Ratio (MLR)
Question: When does the UMP test exist for one-sided composite hypothe-
ses? – Often when pdfs or pmfs have the monotone likelihood ratio property.
A family of pdfs or pmfs {g(t|θ) : θ ∈ Θ} for a univariate random variable
T with real-valued parameter θ has a monotone likelihood ratio (MLR) if
g(t|θ2 )/g(t|θ1 ) is an increasing function of t
for every θ2 > θ1 , on {t : g(t|θ1 ) > 0 or g(t|θ2 ) > 0}.
Examples:
• Normal, Poisson, Binomial all have the MLR property. (Exercise 8.25)
n
• If X1 , . . . , Xn iid from N (µ, σ 2 ) with µ known, then i=1 (Xi − µ)2
has an MLR.
116
Karlin-Rubin Theorem
Suppose T (X) is a sufficient statistic for θ and the family {g(t|θi ), θ ∈ Θ}
is an MLR family. Then
where
α = Pθ0 (T > t0 ).
where
α = Pθ0 (T < t0 ).
117
Example: Let X1 , . . . , Xn be iid from N (µ, σ 2 ), σ 2 known.
(i) Find the UMP level α test for testing H0 : θ ≤ θ0 vs H1 : θ > θ0 .
118
Example: Let X1 , . . . , Xn be iid from N (µ0 , σ 2 ), σ 2 unknown, µ0 known.
Find the UMP level α test for testing
119
10 p-value
Compute p-value
Theorem: Let W (X) be a test statistic such that large values of W give
evidence that H1 is true. For each sample point x, define
p(x) = supθ∈Θ0 Pθ (W (X) ≥ W (x)).
Then p(X) is a valid p-value.
Proof: (see textbook)
120
Example: (two-sided normal p-value)
Let X1 , . . . , Xn be iid from N (θ, σ 2 ), σ 2 unknown. Consider testing H0 :
√
θ = θ0 versus H1 : θ = θ0 , use the LRT statistic W (X) = |X̄ − θ0 |/(S/ n).
(i) Compute the p-value of the LRT statistic W (X).
121