Professional Documents
Culture Documents
Hypothesis Testing
Dave Goldsman
H. Milton Stewart School of Industrial and Systems Engineering
Georgia Institute of Technology
3/2/20
Goal: In this module, we’ll study a population by collecting data and making
sound, statistically valid conclusions about that population based on data that
we collect.
Goal: In this module, we’ll study a population by collecting data and making
sound, statistically valid conclusions about that population based on data that
we collect.
General Approach
Goal: In this module, we’ll study a population by collecting data and making
sound, statistically valid conclusions about that population based on data that
we collect.
General Approach
1. State a hypothesis.
Goal: In this module, we’ll study a population by collecting data and making
sound, statistically valid conclusions about that population based on data that
we collect.
General Approach
1. State a hypothesis.
2. Select a test statistic (to test whether or not the hypothesis is true).
Goal: In this module, we’ll study a population by collecting data and making
sound, statistically valid conclusions about that population based on data that
we collect.
General Approach
1. State a hypothesis.
2. Select a test statistic (to test whether or not the hypothesis is true).
Goal: In this module, we’ll study a population by collecting data and making
sound, statistically valid conclusions about that population based on data that
we collect.
General Approach
1. State a hypothesis.
2. Select a test statistic (to test whether or not the hypothesis is true).
4. Interpret results — does the test statistic suggest that you reject or fail to
reject your hypothesis?
Goal: In this module, we’ll study a population by collecting data and making
sound, statistically valid conclusions about that population based on data that
we collect.
General Approach
1. State a hypothesis.
2. Select a test statistic (to test whether or not the hypothesis is true).
4. Interpret results — does the test statistic suggest that you reject or fail to
reject your hypothesis?
Details follow. . . .
ISYE 6739 — Goldsman 3/2/20 3 / 115
Introduction to Hypothesis Testing
H0 : µ = µ0
H0 : µ = µ0
H1 : µ 6= µ0
H0 : µ = µ0
H1 : µ 6= µ0
H0 : µ = µ0
H1 : µ 6= µ0
This is a two-sided test. We will reject the belief of the null hypothesis H0
if µ̂ (an estimator of µ) is “too high” or “too small.”
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .)
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty.
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
H1 : µ > µ0
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
H1 : µ > µ0
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
H1 : µ > µ0
Example: We test to see if emissions from a certain type of car are less than
a mean of µ0 ppm.
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
H1 : µ > µ0
Example: We test to see if emissions from a certain type of car are less than
a mean of µ0 ppm. But we need evidence.
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
H1 : µ > µ0
Example: We test to see if emissions from a certain type of car are less than
a mean of µ0 ppm. But we need evidence.
H0 : µ ≥ µ0
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
H1 : µ > µ0
Example: We test to see if emissions from a certain type of car are less than
a mean of µ0 ppm. But we need evidence.
H0 : µ ≥ µ0
H1 : µ < µ0
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
H1 : µ > µ0
Example: We test to see if emissions from a certain type of car are less than
a mean of µ0 ppm. But we need evidence.
H0 : µ ≥ µ0
H1 : µ < µ0
Example: We hope that a new brand of tires will last for a mean of more
than µ0 miles. (We specify µ0 .) But we really need evidence before we can
state that claim with reasonable certainty. Else, we’ll stay with the old brand.
H0 : µ ≤ µ0
H1 : µ > µ0
Example: We test to see if emissions from a certain type of car are less than
a mean of µ0 ppm. But we need evidence.
H0 : µ ≥ µ0
H1 : µ < µ0
This is a one-sided test. We’ll reject the null hypothesis if µ̂ is “too small,”
and only then will make the claim that the emissions are low.
X̄ − µ0
zobs = √ (if σ 2 is known) or
σ/ n
X̄ − µ0
zobs = √ (if σ 2 is known) or
σ/ n
X̄ − µ0
tobs = √ (if σ 2 is unknown).
S/ n
X̄ − µ0
zobs = √ (if σ 2 is known) or
σ/ n
X̄ − µ0
tobs = √ (if σ 2 is unknown).
S/ n
(b) Calculate the value of the test statistic based on the data.
(b) Calculate the value of the test statistic based on the data.
(b) Calculate the value of the test statistic based on the data.
(b) Calculate the value of the test statistic based on the data.
(b) Calculate the value of the test statistic based on the data.
(b) Calculate the value of the test statistic based on the data.
H0 : µ ≥ 15
H0 : µ ≥ 15
H1 : µ < 15
H0 : µ ≥ 15
H1 : µ < 15
H0 : µ ≥ 15
H1 : µ < 15
Now, if H0 is actually the true state of things, then µ = µ0 , and from our
discussion on CI’s, we have
X̄ − µ0
tobs = √ ∼ t(n − 1) ∼ t(19).
S/ n
Now, if H0 is actually the true state of things, then µ = µ0 , and from our
discussion on CI’s, we have
X̄ − µ0
tobs = √ ∼ t(n − 1) ∼ t(19).
S/ n
Now, if H0 is actually the true state of things, then µ = µ0 , and from our
discussion on CI’s, we have
X̄ − µ0
tobs = √ ∼ t(n − 1) ∼ t(19).
S/ n
Now, if H0 is actually the true state of things, then µ = µ0 , and from our
discussion on CI’s, we have
X̄ − µ0
tobs = √ ∼ t(n − 1) ∼ t(19).
S/ n
i.e.,
P (t(19) < −1.729) = 0.05 and
i.e.,
P (t(19) < −1.729) = 0.05 and
i.e.,
P (t(19) < −1.729) = 0.05 and
In English: If H0 were true, there’s a 100p% chance that we’d see a value of
tobs that’s ≤ −1.61.
In English: If H0 were true, there’s a 100p% chance that we’d see a value of
tobs that’s ≤ −1.61. That’s not a real high probability, but it’s not toooo small.
In English: If H0 were true, there’s a 100p% chance that we’d see a value of
tobs that’s ≤ −1.61. That’s not a real high probability, but it’s not toooo small.
In English: If H0 were true, there’s a 100p% chance that we’d see a value of
tobs that’s ≤ −1.61. That’s not a real high probability, but it’s not toooo small.
In English: If H0 were true, there’s a 100p% chance that we’d see a value of
tobs that’s ≤ −1.61. That’s not a real high probability, but it’s not toooo small.
In English: If H0 were true, there’s a 100p% chance that we’d see a value of
tobs that’s ≤ −1.61. That’s not a real high probability, but it’s not toooo small.
In English: If H0 were true, there’s a 100p% chance that we’d see a value of
tobs that’s ≤ −1.61. That’s not a real high probability, but it’s not toooo small.
Outline
1 Introduction to Hypothesis Testing
2 The Errors of Our Ways
3 Normal Mean Test with Known Variance
4 Normal Mean Test with Known Variance: Design
5 Two-Sample Normal Means Test with Known Variances
6 Normal Mean Test with Unknown Variance
7 Two-Sample Normal Means Tests with Unknown Variances
8 Two-Sample Normal Means Test with Paired Observations
9 Normal Variance Test
10 Two-Sample Normal Variances Test
11 Bernoulli Proportion Test
12 Two-Sample Bernoulli Proportions Test
13 Goodness-of-Fit Tests: Introduction
14 Goodness-of-Fit Tests: Examples
15 Goodness-of-Fit Tests: Honors Example
ISYE 6739 — Goldsman 3/2/20 14 / 115
The Errors of Our Ways
Decision
State of nature Accept H0 Reject H0
H0 true Correct! Type I error
H0 false Type II error Correct!
Decision
State of nature Accept H0 Reject H0
H0 true Correct! Type I error
H0 false Type II error Correct!
Example: We incorrectly conclude that a new, inferior drug is better than the
drug currently on the market — Type I error.
Decision
State of nature Accept H0 Reject H0
H0 true Correct! Type I error
H0 false Type II error Correct!
Example: We incorrectly conclude that a new, inferior drug is better than the
drug currently on the market — Type I error.
We want to keep:
We want to keep:
We want to keep:
We want to keep:
We want to keep:
We want to keep:
We want to keep:
1 − β = P (Reject H0 | H0 false).
We want to keep:
1 − β = P (Reject H0 | H0 false).
H0 : µ = µ0 vs.
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
X̄ − µ0
Z0 ≡ √ .
σ/ n
X̄ − µ0
Z0 ≡ √ .
σ/ n
X̄ − µ0
Z0 ≡ √ .
σ/ n
X̄ − µ0
Z0 ≡ √ .
σ/ n
Then we have
P (−zα/2 ≤ Z0 ≤ zα/2 ) = 1 − α.
X̄ − µ0
Z0 ≡ √ .
σ/ n
Then we have
P (−zα/2 ≤ Z0 ≤ zα/2 ) = 1 − α.
Therefore,
Therefore,
Therefore,
Therefore,
Therefore,
Therefore,
Therefore,
One-sided test:
One-sided test:
H0 : µ ≤ µ0
One-sided test:
H0 : µ ≤ µ0
H1 : µ > µ0
One-sided test:
H0 : µ ≤ µ0
H1 : µ > µ0
Again let
X̄ − µ0
Z0 = √ .
σ/ n
One-sided test:
H0 : µ ≤ µ0
H1 : µ > µ0
Again let
X̄ − µ0
Z0 = √ .
σ/ n
A value of Z0 outside the interval (−∞, zα ] is highly unlikely if H0 is true.
One-sided test:
H0 : µ ≤ µ0
H1 : µ > µ0
Again let
X̄ − µ0
Z0 = √ .
σ/ n
A value of Z0 outside the interval (−∞, zα ] is highly unlikely if H0 is true.
Therefore,
One-sided test:
H0 : µ ≤ µ0
H1 : µ > µ0
Again let
X̄ − µ0
Z0 = √ .
σ/ n
A value of Z0 outside the interval (−∞, zα ] is highly unlikely if H0 is true.
Therefore,
H0 : µ ≥ µ0
H0 : µ ≥ µ0
H1 : µ < µ0
H0 : µ ≥ µ0
H1 : µ < µ0
H0 : µ ≥ µ0
H1 : µ < µ0
H0 : µ ≥ µ0
H1 : µ < µ0
H0 : µ = µ0 vs.
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
Here we have
X̄ − µ0
Z0 = √
σ/ n
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
Here we have
X̄ − µ0 62 − 60
Z0 = √ = √
σ/ n 4/ 25
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
Here we have
X̄ − µ0 62 − 60
Z0 = √ = √ = 2.5.
σ/ n 4/ 25
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
Here we have
X̄ − µ0 62 − 60
Z0 = √ = √ = 2.5.
σ/ n 4/ 25
Since |Z0 | = 2.5 > zα/2 = z0.025 = 1.96, we reject H0 .
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
Here we have
X̄ − µ0 62 − 60
Z0 = √ = √ = 2.5.
σ/ n 4/ 25
Since |Z0 | = 2.5 > zα/2 = z0.025 = 1.96, we reject H0 .
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
Here we have
X̄ − µ0 62 − 60
Z0 = √ = √ = 2.5.
σ/ n 4/ 25
Since |Z0 | = 2.5 > zα/2 = z0.025 = 1.96, we reject H0 .
Notice that a lower α results in a higher zα/2 . Then it’s “harder” to reject H0 .
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
Here we have
X̄ − µ0 62 − 60
Z0 = √ = √ = 2.5.
σ/ n 4/ 25
Since |Z0 | = 2.5 > zα/2 = z0.025 = 1.96, we reject H0 .
Notice that a lower α results in a higher zα/2 . Then it’s “harder” to reject H0 .
For instance, if α = 0.01, then z0.005 = 2.58,
H0 : µ = µ0 vs. H1 : µ 6= µ0 .
Here we have
X̄ − µ0 62 − 60
Z0 = √ = √ = 2.5.
σ/ n 4/ 25
Since |Z0 | = 2.5 > zα/2 = z0.025 = 1.96, we reject H0 .
Notice that a lower α results in a higher zα/2 . Then it’s “harder” to reject H0 .
For instance, if α = 0.01, then z0.005 = 2.58, and we would fail to reject H0
in this example. 2
Remark: Researchers often report the p-values of any tests that they conduct.
Remark: Researchers often report the p-values of any tests that they conduct.
For the two-sided normal mean test with known variance, we reject H0 iff
Remark: Researchers often report the p-values of any tests that they conduct.
For the two-sided normal mean test with known variance, we reject H0 iff
Remark: Researchers often report the p-values of any tests that they conduct.
For the two-sided normal mean test with known variance, we reject H0 iff
Remark: Researchers often report the p-values of any tests that they conduct.
For the two-sided normal mean test with known variance, we reject H0 iff
Remark: Researchers often report the p-values of any tests that they conduct.
For the two-sided normal mean test with known variance, we reject H0 iff
Remark: Researchers often report the p-values of any tests that they conduct.
For the two-sided normal mean test with known variance, we reject H0 iff
H0 : µ = µ0 vs. H1 : µ 6= µ0 ,
Remark: Researchers often report the p-values of any tests that they conduct.
For the two-sided normal mean test with known variance, we reject H0 iff
H0 : µ = µ0 vs. H1 : µ 6= µ0 ,
H0 : µ ≤ µ0 vs. H1 : µ > µ0 ,
H0 : µ ≤ µ0 vs. H1 : µ > µ0 ,
we have p = 1 − Φ(Z0 ).
H0 : µ ≤ µ0 vs. H1 : µ > µ0 ,
we have p = 1 − Φ(Z0 ).
H0 : µ ≤ µ0 vs. H1 : µ > µ0 ,
we have p = 1 − Φ(Z0 ).
H0 : µ ≥ µ0 vs. H1 : µ < µ0 ,
H0 : µ ≤ µ0 vs. H1 : µ > µ0 ,
we have p = 1 − Φ(Z0 ).
H0 : µ ≥ µ0 vs. H1 : µ < µ0 ,
we have p = Φ(Z0 ).
H0 : µ ≤ µ0 vs. H1 : µ > µ0 ,
we have p = 1 − Φ(Z0 ).
H0 : µ ≥ µ0 vs. H1 : µ < µ0 ,
we have p = Φ(Z0 ).
H0 : µ ≤ µ0 vs. H1 : µ > µ0 ,
we have p = 1 − Φ(Z0 ).
H0 : µ ≥ µ0 vs. H1 : µ < µ0 ,
we have p = Φ(Z0 ).
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
P (Type I error) ≤ α and P Type II error | µ = µ1 > µ0 ≤ β.
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
P (Type I error) ≤ α and P Type II error | µ = µ1 > µ0 ≤ β.
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
P (Type I error) ≤ α and P Type II error | µ = µ1 > µ0 ≤ β.
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
P (Type I error) ≤ α and P Type II error | µ = µ1 > µ0 ≤ β.
Remark: The bound β is for the special case that the true mean µ happens to
equal a user-specified value µ = µ1 > µ0 .
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
P (Type I error) ≤ α and P Type II error | µ = µ1 > µ0 ≤ β.
Remark: The bound β is for the special case that the true mean µ happens to
equal a user-specified value µ = µ1 > µ0 . In other words, we’re trying to
“protect” ourselves against the possibility that µ actually happens to equal µ1 .
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
P (Type I error) ≤ α and P Type II error | µ = µ1 > µ0 ≤ β.
Remark: The bound β is for the special case that the true mean µ happens to
equal a user-specified value µ = µ1 > µ0 . In other words, we’re trying to
“protect” ourselves against the possibility that µ actually happens to equal µ1 .
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
P (Type I error) ≤ α and P Type II error | µ = µ1 > µ0 ≤ β.
Remark: The bound β is for the special case that the true mean µ happens to
equal a user-specified value µ = µ1 > µ0 . In other words, we’re trying to
“protect” ourselves against the possibility that µ actually happens to equal µ1 .
Goal: Design a two-sided test with the following constraints on Type I and II
errors:
P (Type I error) ≤ α and P Type II error | µ = µ1 > µ0 ≤ β.
Remark: The bound β is for the special case that the true mean µ happens to
equal a user-specified value µ = µ1 > µ0 . In other words, we’re trying to
“protect” ourselves against the possibility that µ actually happens to equal µ1 .
Remark: In the proof that follows, we’ll get an expression for β that involves
the standard normal cdf evaluated at a mess that contains n.
Remark: In the proof that follows, we’ll get an expression for β that involves
the standard normal cdf evaluated at a mess that contains n. We’ll then do an
inversion to obtain the desired approximation for n.
= P (|Z0 | ≤ zα/2 | µ = µ1 )
= P (|Z0 | ≤ zα/2 | µ = µ1 )
= P (−zα/2 ≤ Z0 ≤ zα/2 | µ = µ1 )
= P (|Z0 | ≤ zα/2 | µ = µ1 )
= P (−zα/2 ≤ Z0 ≤ zα/2 | µ = µ1 )
X̄ − µ0
= P −zα/2 ≤ √ ≤ zα/2 µ = µ1
σ/ n
= P (|Z0 | ≤ zα/2 | µ = µ1 )
= P (−zα/2 ≤ Z0 ≤ zα/2 | µ = µ1 )
X̄ − µ0
= P −zα/2 ≤ √ ≤ zα/2 µ = µ1
σ/ n
X̄ − µ1 µ1 − µ0
= P −zα/2 ≤ √ + √ ≤ zα/2 µ = µ1 .
σ/ n σ/ n
Notice that
X̄ − µ1
Z ≡ √ ∼ Nor(0, 1).
σ/ n
Notice that
X̄ − µ1
Z ≡ √ ∼ Nor(0, 1).
σ/ n
This gives
√
nδ
β = P −zα/2 ≤ Z+ ≤ zα/2
σ
Notice that
X̄ − µ1
Z ≡ √ ∼ Nor(0, 1).
σ/ n
This gives
√
nδ
β = P −zα/2 ≤ Z + ≤ zα/2
σ
√ √
nδ nδ
= P −zα/2 − ≤ Z ≤ zα/2 −
σ σ
Notice that
X̄ − µ1
Z ≡ √ ∼ Nor(0, 1).
σ/ n
This gives
√
nδ
β = P −zα/2 ≤ Z + ≤ zα/2
σ
√ √
nδ nδ
= P −zα/2 − ≤ Z ≤ zα/2 −
σ σ
√ √
nδ nδ
= Φ zα/2 − − Φ −zα/2 − .
σ σ
Notice that
X̄ − µ1
Z ≡ √ ∼ Nor(0, 1).
σ/ n
This gives
√
nδ
β = P −zα/2 ≤ Z + ≤ zα/2
σ
√ √
nδ nδ
= P −zα/2 − ≤ Z ≤ zα/2 −
σ σ
√ √
nδ nδ
= Φ zα/2 − − Φ −zα/2 − .
σ σ
√
Now, note that −zα/2 0 and − nδ/σ < 0 (since δ > 0).
Notice that
X̄ − µ1
Z ≡ √ ∼ Nor(0, 1).
σ/ n
This gives
√
nδ
β = P −zα/2 ≤ Z + ≤ zα/2
σ
√ √
nδ nδ
= P −zα/2 − ≤ Z ≤ zα/2 −
σ σ
√ √
nδ nδ
= Φ zα/2 − − Φ −zα/2 − .
σ σ
√
Now, note that −zα/2 0 and − nδ/σ < 0 (since δ > 0).
These two facts imply that the second Φ(·) is pretty much zero, so. . .
We only need to use the first term in the previous expression for β:
We only need to use the first term in the previous expression for β:
√
. nδ
β = Φ zα/2 −
σ
We only need to use the first term in the previous expression for β:
√
. nδ
β = Φ zα/2 −
σ
iff √
−1 . nδ
Φ (β) = −zβ = zα/2 −
σ
We only need to use the first term in the previous expression for β:
√
. nδ
β = Φ zα/2 −
σ
iff √
−1 . nδ
Φ (β) = −zβ = zα/2 −
σ
iff √
nδ .
= zα/2 + zβ
σ
We only need to use the first term in the previous expression for β:
√
. nδ
β = Φ zα/2 −
σ
iff √
−1 . nδ
Φ (β) = −zβ = zα/2 −
σ
iff √
nδ .
= zα/2 + zβ
σ
iff
.
n = σ 2 (zα/2 + zβ )2 /δ 2 . Done! Whew!
Similarly, if you’re doing a one-sided test, it turns out that you need to take
.
n = σ 2 (zα + zβ )2 /δ 2 observations.
Similarly, if you’re doing a one-sided test, it turns out that you need to take
.
n = σ 2 (zα + zβ )2 /δ 2 observations.
Similarly, if you’re doing a one-sided test, it turns out that you need to take
.
n = σ 2 (zα + zβ )2 /δ 2 observations.
Similarly, if you’re doing a one-sided test, it turns out that you need to take
.
n = σ 2 (zα + zβ )2 /δ 2 observations.
Similarly, if you’re doing a one-sided test, it turns out that you need to take
.
n = σ 2 (zα + zβ )2 /δ 2 observations.
. σ2
n = 2 (zα/2 + zβ )2
δ
Similarly, if you’re doing a one-sided test, it turns out that you need to take
.
n = σ 2 (zα + zβ )2 /δ 2 observations.
. σ2 16
n = 2 (zα/2 + zβ )2 = (1.96 + 1.645)2 = 51.98.
δ 4
Similarly, if you’re doing a one-sided test, it turns out that you need to take
.
n = σ 2 (zα + zβ )2 /δ 2 observations.
. σ2 16
n = 2 (zα/2 + zβ )2 = (1.96 + 1.645)2 = 51.98.
δ 4
In other words, we need about 52 observations. 2
H0 : µx = µy
H0 : µx = µy
H1 : µx 6= µy
X̄ − Ȳ
Z0 = q ∼ Nor(0, 1).
σx2 σy2
n + m
X̄ − Ȳ
Z0 = q ∼ Nor(0, 1).
σx2 σy2
n + m
Thus, as before,
X̄ − Ȳ
Z0 = q ∼ Nor(0, 1).
σx2 σy2
n + m
Thus, as before,
Using more of the same reasoning as before, we get the following one-sided
tests:
Using more of the same reasoning as before, we get the following one-sided
tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
Using more of the same reasoning as before, we get the following one-sided
tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
Using more of the same reasoning as before, we get the following one-sided
tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
H0 : µx ≥ µy vs. H1 : µx < µy .
Using more of the same reasoning as before, we get the following one-sided
tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
H0 : µx ≥ µy vs. H1 : µx < µy .
Using more of the same reasoning as before, we get the following one-sided
tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
H0 : µx ≥ µy vs. H1 : µx < µy .
It’s so easy!!
Then
824.9 − 818.6
Z0 = q = 2.10.
40 50
10 + 10
Then
824.9 − 818.6
Z0 = q = 2.10.
40 50
10 + 10
Then
824.9 − 818.6
Z0 = q = 2.10.
40 50
10 + 10
The next few lessons deal with the unknown variance case.
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
iid
Suppose X1 , . . . , Xn ∼ Nor(µ, σ 2 ),
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
iid
Suppose X1 , . . . , Xn ∼ Nor(µ, σ 2 ), where σ 2 is unknown.
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
iid
Suppose X1 , . . . , Xn ∼ Nor(µ, σ 2 ), where σ 2 is unknown.
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
iid
Suppose X1 , . . . , Xn ∼ Nor(µ, σ 2 ), where σ 2 is unknown.
H0 : µ = µ 0 vs. H1 : µ 6= µ0 .
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
iid
Suppose X1 , . . . , Xn ∼ Nor(µ, σ 2 ), where σ 2 is unknown.
H0 : µ = µ 0 vs. H1 : µ 6= µ0 .
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
iid
Suppose X1 , . . . , Xn ∼ Nor(µ, σ 2 ), where σ 2 is unknown.
H0 : µ = µ 0 vs. H1 : µ 6= µ0 .
The next few lessons deal with the unknown variance case.
Test the mean of a single normal distribution (here).
Compare the means of two normal distributions when both variances are
unknown (the following three lessons deal with different subcases).
iid
Suppose X1 , . . . , Xn ∼ Nor(µ, σ 2 ), where σ 2 is unknown.
H0 : µ = µ 0 vs. H1 : µ 6= µ0 .
If H0 is true, then
If H0 is true, then
X̄−µ0
√
σ 2 /n
T0 = p
S 2 /σ 2
If H0 is true, then
X̄−µ0
√
σ 2 /n Nor(0, 1)
T0 = p ∼ q 2 ∼ t(n − 1).
S 2 /σ 2 χ (n−1)
n−1
Using the same reasoning as in previous lessons, the one-sided tests are:
Using the same reasoning as in previous lessons, the one-sided tests are:
H0 : µ ≤ µ0 vs. H1 : µ > µ0 .
Using the same reasoning as in previous lessons, the one-sided tests are:
H0 : µ ≤ µ0 vs. H1 : µ > µ0 .
Using the same reasoning as in previous lessons, the one-sided tests are:
H0 : µ ≤ µ0 vs. H1 : µ > µ0 .
H0 : µ ≥ µ0 vs. H1 : µ < µ0 .
Using the same reasoning as in previous lessons, the one-sided tests are:
H0 : µ ≤ µ0 vs. H1 : µ > µ0 .
H0 : µ ≥ µ0 vs. H1 : µ < µ0 .
For this two-sided normal mean test with unknown variance, we reject H0 iff
For this two-sided normal mean test with unknown variance, we reject H0 iff
−1
|T0 | > tα/2,n−1 = Fn−1 (1 − α/2),
For this two-sided normal mean test with unknown variance, we reject H0 iff
−1
|T0 | > tα/2,n−1 = Fn−1 (1 − α/2),
−1
where Fn−1 (t) is the cdf of the t(n − 1) distribution (and Fn−1 (·) is the
inverse).
For this two-sided normal mean test with unknown variance, we reject H0 iff
−1
|T0 | > tα/2,n−1 = Fn−1 (1 − α/2),
−1
where Fn−1 (t) is the cdf of the t(n − 1) distribution (and Fn−1 (·) is the
inverse). This relationship holds iff
Fn−1 (|T0 |) > 1 − α/2 iff α > 2 1 − Fn−1 (|T0 |) .
For this two-sided normal mean test with unknown variance, we reject H0 iff
−1
|T0 | > tα/2,n−1 = Fn−1 (1 − α/2),
−1
where Fn−1 (t) is the cdf of the t(n − 1) distribution (and Fn−1 (·) is the
inverse). This relationship holds iff
Fn−1 (|T0 |) > 1 − α/2 iff α > 2 1 − Fn−1 (|T0 |) .
Thus, for the two-sided test for the case of unknown variance,
H0 : µ = µ0 vs. H1 : µ 6= µ0 ,
For this two-sided normal mean test with unknown variance, we reject H0 iff
−1
|T0 | > tα/2,n−1 = Fn−1 (1 − α/2),
−1
where Fn−1 (t) is the cdf of the t(n − 1) distribution (and Fn−1 (·) is the
inverse). This relationship holds iff
Fn−1 (|T0 |) > 1 − α/2 iff α > 2 1 − Fn−1 (|T0 |) .
Thus, for the two-sided test for the case of unknown variance,
vs. H1 : µ 6= µ0 ,
H0 : µ = µ0
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Then
X̄ − µ0
T0 ≡ √ = 2.07.
S/ n
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Then
X̄ − µ0
T0 ≡ √ = 2.07.
S/ n
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Then
X̄ − µ0
T0 ≡ √ = 2.07.
S/ n
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Then
X̄ − µ0
T0 ≡ √ = 2.07.
S/ n
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Then
X̄ − µ0
T0 ≡ √ = 2.07.
S/ n
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Then
X̄ − µ0
T0 ≡ √ = 2.07.
S/ n
Example: Suppose we want to test at level 0.05 whether or not the mean of
some process is 150.
Then
X̄ − µ0
T0 ≡ √ = 2.07.
S/ n
where the samples are independent of each other, and σx2 and σy2 are unknown.
where the samples are independent of each other, and σx2 and σy2 are unknown.
where the samples are independent of each other, and σx2 and σy2 are unknown.
where the samples are independent of each other, and σx2 and σy2 are unknown.
where the samples are independent of each other, and σx2 and σy2 are unknown.
where the samples are independent of each other, and σx2 and σy2 are unknown.
Pooled t-Test
Pooled t-Test
Pooled t-Test
Pooled t-Test
Pooled t-Test
σ 2 χ2 (n + m − 2)
Sp2 ∼ ,
n+m−2
σ 2 χ2 (n + m − 2)
Sp2 ∼ ,
n+m−2
and then the test statistic
X̄ − Ȳ
T0 ≡ q ∼ t(n + m − 2).
Sp n1 + 1
m
σ 2 χ2 (n + m − 2)
Sp2 ∼ ,
n+m−2
and then the test statistic
X̄ − Ȳ
T0 ≡ q ∼ t(n + m − 2).
Sp n1 + 1
m
Thus,
Reject H0 iff |T0 | > tα/2,n+m−2 .
One-Sided Tests:
One-Sided Tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
One-Sided Tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
One-Sided Tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
H0 : µx ≥ µy vs. H1 : µx < µy .
One-Sided Tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
H0 : µx ≥ µy vs. H1 : µx < µy .
One-Sided Tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
H0 : µx ≥ µy vs. H1 : µx < µy .
One-Sided Tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
H0 : µx ≥ µy vs. H1 : µx < µy .
One-Sided Tests:
H0 : µx ≤ µy vs. H1 : µx > µy .
H0 : µx ≥ µy vs. H1 : µx < µy .
.
Sx2 is pretty close to Sy2 , so we’ll assume σx2 = σy2 .
.
Sx2 is pretty close to Sy2 , so we’ll assume σx2 = σy2 .
(n − 1)Sx2 + (m − 1)Sy2
Sp2 = = 3.955,
n+m−2
.
Sx2 is pretty close to Sy2 , so we’ll assume σx2 = σy2 .
(n − 1)Sx2 + (m − 1)Sy2
Sp2 = = 3.955,
n+m−2
so that
X̄ − Ȳ
T0 = q = −2.03.
Sp n1 + 1
m
.
Sx2 is pretty close to Sy2 , so we’ll assume σx2 = σy2 .
(n − 1)Sx2 + (m − 1)Sy2
Sp2 = = 3.955,
n+m−2
so that
X̄ − Ȳ
T0 = q = −2.03.
Sp n1 + 1
m
.
Sx2 is pretty close to Sy2 , so we’ll assume σx2 = σy2 .
(n − 1)Sx2 + (m − 1)Sy2
Sp2 = = 3.955,
n+m−2
so that
X̄ − Ȳ
T0 = q = −2.03.
Sp n1 + 1
m
.
Sx2 is pretty close to Sy2 , so we’ll assume σx2 = σy2 .
(n − 1)Sx2 + (m − 1)Sy2
Sp2 = = 3.955,
n+m−2
so that
X̄ − Ȳ
T0 = q = −2.03.
Sp n1 + 1
m
Approximate t-Test
Approximate t-Test
Approximate t-Test
Suppose that σx2 6= σy2 (both unknown). As with our work with CIs, define
X̄ − Ȳ
T0? ≡ q ≈ t(ν) (if H0 true),
Sx2 Sy2
n + m
Approximate t-Test
Suppose that σx2 6= σy2 (both unknown). As with our work with CIs, define
X̄ − Ȳ
T0? ≡ q ≈ t(ν) (if H0 true),
Sx2 Sy2
n + m
Approximate t-Test
Suppose that σx2 6= σy2 (both unknown). As with our work with CIs, define
X̄ − Ȳ
T0? ≡ q ≈ t(ν) (if H0 true),
Sx2 Sy2
n + m
The following table summarizes how to carry out the various two- and
one-sided tests.
Plug-and-chug to get
T0? = 0.184,
Plug-and-chug to get
.
T0? = 0.184, ν = 14.9 = 15,
Plug-and-chug to get
.
T0? = 0.184, ν = 14.9 = 15, and tα/2,ν = t0.05,15 = 1.753.
Plug-and-chug to get
.
T0? = 0.184, ν = 14.9 = 15, and tα/2,ν = t0.05,15 = 1.753.
Plug-and-chug to get
.
T0? = 0.184, ν = 14.9 = 15, and tα/2,ν = t0.05,15 = 1.753.
The RV’s between different pairs are independent. The two observations
within the same pair may not be independent —
The RV’s between different pairs are independent. The two observations
within the same pair may not be independent — in fact, it’s often good for
them to be positively correlated (as explained in the previous module)!
The RV’s between different pairs are independent. The two observations
within the same pair may not be independent — in fact, it’s often good for
them to be positively correlated (as explained in the previous module)!
Example: One twin takes a new drug, the other takes a placebo.
The RV’s between different pairs are independent. The two observations
within the same pair may not be independent — in fact, it’s often good for
them to be positively correlated (as explained in the previous module)!
Example: One twin takes a new drug, the other takes a placebo.
Pair 1 : (X1 , Y1 )
independent
The RV’s between different pairs are independent. The two observations
within the same pair may not be independent — in fact, it’s often good for
them to be positively correlated (as explained in the previous module)!
Example: One twin takes a new drug, the other takes a placebo.
Pair 1 : (X1 , Y1 )
Pair 2 : (X2 , Y2 )
independent
The RV’s between different pairs are independent. The two observations
within the same pair may not be independent — in fact, it’s often good for
them to be positively correlated (as explained in the previous module)!
Example: One twin takes a new drug, the other takes a placebo.
Pair 1 : (X1 , Y1 )
Pair 2 : (X2 , Y2 )
.. ..
independent . .
Pair n : (Xn , Yn )
| {z }
not indep
ISYE 6739 — Goldsman 3/2/20 55 / 115
Two-Sample Normal Means Test with Paired Observations
Di ≡ Xi − Yi , i = 1, 2, . . . , n.
Di ≡ Xi − Yi , i = 1, 2, . . . , n.
iid
Note that D1 , D2 , . . . , Dn ∼ Nor(µd , σd2 ),
Di ≡ Xi − Yi , i = 1, 2, . . . , n.
iid
Note that D1 , D2 , . . . , Dn ∼ Nor(µd , σd2 ), where
µd ≡ µ x − µy
Di ≡ Xi − Yi , i = 1, 2, . . . , n.
iid
Note that D1 , D2 , . . . , Dn ∼ Nor(µd , σd2 ), where
Di ≡ Xi − Yi , i = 1, 2, . . . , n.
iid
Note that D1 , D2 , . . . , Dn ∼ Nor(µd , σd2 ), where
D̄
T0 ≡ q ∼ t(n − 1).
Sd2 /n
D̄
T0 ≡ q ∼ t(n − 1).
Sd2 /n
D̄
T0 ≡ q ∼ t(n − 1).
Sd2 /n
D̄
T0 ≡ q ∼ t(n − 1).
Sd2 /n
D̄
T0 ≡ q ∼ t(n − 1).
Sd2 /n
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Example: Times for (the same) people to parallel park two cars.
Consider the two-sided test (where you specify the hypothesized σ02 ):
Consider the two-sided test (where you specify the hypothesized σ02 ):
Consider the two-sided test (where you specify the hypothesized σ02 ):
Consider the two-sided test (where you specify the hypothesized σ02 ):
One-Sided Tests:
One-Sided Tests:
H0 : σ 2 ≤ σ02 vs. H1 : σ 2 > σ02 .
One-Sided Tests:
H0 : σ 2 ≤ σ02 vs. H1 : σ 2 > σ02 .
One-Sided Tests:
H0 : σ 2 ≤ σ02 vs. H1 : σ 2 > σ02 .
One-Sided Tests:
H0 : σ 2 ≤ σ02 vs. H1 : σ 2 > σ02 .
Example: Suppose we want to test at level 0.05, whether or not the variance
of a certain process is ≤ 0.02, specifically,
Example: Suppose we want to test at level 0.05, whether or not the variance
of a certain process is ≤ 0.02, specifically,
Example: Suppose we want to test at level 0.05, whether or not the variance
of a certain process is ≤ 0.02, specifically,
Example: Suppose we want to test at level 0.05, whether or not the variance
of a certain process is ≤ 0.02, specifically,
Example: Suppose we want to test at level 0.05, whether or not the variance
of a certain process is ≤ 0.02, specifically,
Then the test statistic χ20 = (n − 1)S 2 /σ02 = 21.375 (and isn’t explicitly
dependent on X̄).
Example: Suppose we want to test at level 0.05, whether or not the variance
of a certain process is ≤ 0.02, specifically,
Then the test statistic χ20 = (n − 1)S 2 /σ02 = 21.375 (and isn’t explicitly
dependent on X̄).
Example: Suppose we want to test at level 0.05, whether or not the variance
of a certain process is ≤ 0.02, specifically,
Then the test statistic χ20 = (n − 1)S 2 /σ02 = 21.375 (and isn’t explicitly
dependent on X̄).
So we fail to reject H0 . 2
We’ll estimate the variances σx2 and σy2 by the sample variances Sx2 and Sy2 .
Two-sided test: H0 : σx2 = σy2 (or H0 : σx2 /σy2 = 1) vs. H1 : σx2 6= σy2 .
Two-sided test: H0 : σx2 = σy2 (or H0 : σx2 /σy2 = 1) vs. H1 : σx2 6= σy2 .
Two-sided test: H0 : σx2 = σy2 (or H0 : σx2 /σy2 = 1) vs. H1 : σx2 6= σy2 .
Two-sided test: H0 : σx2 = σy2 (or H0 : σx2 /σy2 = 1) vs. H1 : σx2 6= σy2 .
Two-sided test: H0 : σx2 = σy2 (or H0 : σx2 /σy2 = 1) vs. H1 : σx2 6= σy2 .
Two-sided test: H0 : σx2 = σy2 (or H0 : σx2 /σy2 = 1) vs. H1 : σx2 6= σy2 .
One-Sided Tests:
One-Sided Tests:
One-Sided Tests:
One-Sided Tests:
One-Sided Tests:
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
If the ratio of the sample variances is “too high” or “too low,” reject H0 .
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
If the ratio of the sample variances is “too high” or “too low,” reject H0 .
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
If the ratio of the sample variances is “too high” or “too low,” reject H0 .
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
If the ratio of the sample variances is “too high” or “too low,” reject H0 .
F1−α/2,n−1,m−1
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
If the ratio of the sample variances is “too high” or “too low,” reject H0 .
1
F1−α/2,n−1,m−1 = Fα/2,m−1,n−1
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
If the ratio of the sample variances is “too high” or “too low,” reject H0 .
1 1
F1−α/2,n−1,m−1 = Fα/2,m−1,n−1 = F0.025,7,6 = 1/5.695 = 0.176, and
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
If the ratio of the sample variances is “too high” or “too low,” reject H0 .
1 1
F1−α/2,n−1,m−1 = Fα/2,m−1,n−1 = F0.025,7,6 = 1/5.695 = 0.176, and
Example: Suppose we want to test at level 0.05 whether or not two processes
have the same variance.
If the ratio of the sample variances is “too high” or “too low,” reject H0 .
1 1
F1−α/2,n−1,m−1 = Fα/2,m−1,n−1 = F0.025,7,6 = 1/5.695 = 0.176, and
H0 : p = p0 vs. H1 : p 6= p0 .
H0 : p = p0 vs. H1 : p 6= p0 .
Pn
Let Y = i=1 Xi ∼ Bin(n, p).
H0 : p = p0 vs. H1 : p 6= p0 .
Pn
Let Y = i=1 Xi ∼ Bin(n, p).
H0 : p = p0 vs. H1 : p 6= p0 .
Pn
Let Y = i=1 Xi ∼ Bin(n, p).
H0 : p = p0 vs. H1 : p 6= p0 .
Pn
Let Y = i=1 Xi ∼ Bin(n, p).
Z0 ≈ Nor(0, 1).
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Remark: In order for the CLT to work, you need n large (say at least 30),
and both np ≥ 5 and nq ≥ 5 (so that p isn’t too close to 0 or 1).
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Remark: In order for the CLT to work, you need n large (say at least 30),
and both np ≥ 5 and nq ≥ 5 (so that p isn’t too close to 0 or 1).
Remark: If n isn’t very big, you may have to use Binomial tables (instead of
the normal approximation).
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Remark: In order for the CLT to work, you need n large (say at least 30),
and both np ≥ 5 and nq ≥ 5 (so that p isn’t too close to 0 or 1).
Remark: If n isn’t very big, you may have to use Binomial tables (instead of
the normal approximation). This gets tedious, and I won’t go into it here!
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Remark: In order for the CLT to work, you need n large (say at least 30),
and both np ≥ 5 and nq ≥ 5 (so that p isn’t too close to 0 or 1).
Remark: If n isn’t very big, you may have to use Binomial tables (instead of
the normal approximation). This gets tedious, and I won’t go into it here!
One-Sided Tests:
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Remark: In order for the CLT to work, you need n large (say at least 30),
and both np ≥ 5 and nq ≥ 5 (so that p isn’t too close to 0 or 1).
Remark: If n isn’t very big, you may have to use Binomial tables (instead of
the normal approximation). This gets tedious, and I won’t go into it here!
One-Sided Tests:
H0 : p ≤ p0 vs. H1 : p > p0 .
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Remark: In order for the CLT to work, you need n large (say at least 30),
and both np ≥ 5 and nq ≥ 5 (so that p isn’t too close to 0 or 1).
Remark: If n isn’t very big, you may have to use Binomial tables (instead of
the normal approximation). This gets tedious, and I won’t go into it here!
One-Sided Tests:
H0 : p ≤ p0 vs. H1 : p > p0 .
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Remark: In order for the CLT to work, you need n large (say at least 30),
and both np ≥ 5 and nq ≥ 5 (so that p isn’t too close to 0 or 1).
Remark: If n isn’t very big, you may have to use Binomial tables (instead of
the normal approximation). This gets tedious, and I won’t go into it here!
One-Sided Tests:
H0 : p ≤ p0 vs. H1 : p > p0 .
H0 : p ≥ p0 vs. H1 : p < p0 .
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
Remark: In order for the CLT to work, you need n large (say at least 30),
and both np ≥ 5 and nq ≥ 5 (so that p isn’t too close to 0 or 1).
Remark: If n isn’t very big, you may have to use Binomial tables (instead of
the normal approximation). This gets tedious, and I won’t go into it here!
One-Sided Tests:
H0 : p ≤ p0 vs. H1 : p > p0 .
H0 : p ≥ p0 vs. H1 : p < p0 .
Sample-Size Selection
Sample-Size Selection
Sample-Size Selection
P (Type I error) = α
Sample-Size Selection
Sample-Size Selection
Sample-Size Selection
Sample-Size Selection
Sample-Size Selection
Sample-Size Selection
Sample-Size Selection
β = P (Type II error)
β = P (Type II error)
= P (Fail to Reject H0 | H0 false)
β = P (Type II error)
= P (Fail to Reject H0 | H0 false)
.
= P (|Z0 | ≤ zα/2 | p 6= p0 ) (by the CLT)
β = P (Type II error)
= P (Fail to Reject H0 | H0 false)
.
= P (|Z0 | ≤ zα/2 | p 6= p0 ) (by the CLT)
= P (−zα/2 ≤ Z0 ≤ zα/2 | p 6= p0 )
β = P (Type II error)
= P (Fail to Reject H0 | H0 false)
.
= P (|Z0 | ≤ zα/2 | p 6= p0 ) (by the CLT)
= P (−zα/2 ≤ Z0 ≤ zα/2 | p 6= p0 )
Y − np0
= P −zα/2 ≤ p ≤ zα/2 p 6= p0
np0 (1 − p0 )
β = P (Type II error)
= P (Fail to Reject H0 | H0 false)
.
= P (|Z0 | ≤ zα/2 | p 6= p0 ) (by the CLT)
= P (−zα/2 ≤ Z0 ≤ zα/2 | p 6= p0 )
Y − np0
= P −zα/2 ≤ p ≤ zα/2 p 6= p0
np0 (1 − p0 )
Y − np0
r r
p0 q0 p0 q0
= P −zα/2 ≤ √ ≤ zα/2 p 6= p0
pq npq pq
β = P (Type II error)
= P (Fail to Reject H0 | H0 false)
.
= P (|Z0 | ≤ zα/2 | p 6= p0 ) (by the CLT)
= P (−zα/2 ≤ Z0 ≤ zα/2 | p 6= p0 )
Y − np0
= P −zα/2 ≤ p ≤ zα/2 p 6= p0
np0 (1 − p0 )
Y − np0
r r
p0 q0 p0 q0
= P −zα/2 ≤ √ ≤ zα/2 p 6= p0
pq npq pq
Y − np n(p − p0 )
= P −c ≤ √ + √ ≤ c p 6= p0 ,
npq npq
β = P (Type II error)
= P (Fail to Reject H0 | H0 false)
.
= P (|Z0 | ≤ zα/2 | p 6= p0 ) (by the CLT)
= P (−zα/2 ≤ Z0 ≤ zα/2 | p 6= p0 )
Y − np0
= P −zα/2 ≤ p ≤ zα/2 p 6= p0
np0 (1 − p0 )
Y − np0
r r
p0 q0 p0 q0
= P −zα/2 ≤ √ ≤ zα/2 p 6= p0
pq npq pq
Y − np n(p − p0 )
= P −c ≤ √ + √ ≤ c p 6= p0 ,
npq npq
where r
p 0 q0
c ≡ zα/2 .
pq
This gives
. n(p − p0 )
β = P −c ≤ Z + √ ≤ c
npq
This gives
. n(p − p0 )
β = P −c ≤ Z + √ ≤ c
npq
√ √
n(p − p0 ) n(p − p0 )
= P −c − √ ≤ Z ≤ c− √
pq pq
This gives
. n(p − p0 )
β = P −c ≤ Z + √ ≤ c
npq
√ √
n(p − p0 ) n(p − p0 )
= P −c − √ ≤ Z ≤ c− √
pq pq
= P (−c − d ≤ Z ≤ c − d)
This gives
. n(p − p0 )
β = P −c ≤ Z + √ ≤ c
npq
√ √
n(p − p0 ) n(p − p0 )
= P −c − √ ≤ Z ≤ c− √
pq pq
= P (−c − d ≤ Z ≤ c − d)
= Φ(c − d) − Φ(−c − d),
This gives
. n(p − p0 )
β = P −c ≤ Z + √ ≤ c
npq
√ √
n(p − p0 ) n(p − p0 )
= P −c − √ ≤ Z ≤ c− √
pq pq
= P (−c − d ≤ Z ≤ c − d)
= Φ(c − d) − Φ(−c − d),
where √
n(p − p0 )
d ≡ √ .
pq
.
−zβ ≡ Φ−1 (β) = c − d
In order to design our test (i.e., determine its sample size), let’s set our Type I
error probability to α = 0.05.
In order to design our test (i.e., determine its sample size), let’s set our Type I
error probability to α = 0.05.
We’d like to protect against goofing up on the poor performance side, so let’s
set our Type II to error to β = 0.10 in the special case that p = p1 = 0.7.
In order to design our test (i.e., determine its sample size), let’s set our Type I
error probability to α = 0.05.
We’d like to protect against goofing up on the poor performance side, so let’s
set our Type II to error to β = 0.10 in the special case that p = p1 = 0.7.
Then
√ √
zα/2 p0 q0 + zβ p1 q1 2
.
n =
p1 − p0
In order to design our test (i.e., determine its sample size), let’s set our Type I
error probability to α = 0.05.
We’d like to protect against goofing up on the poor performance side, so let’s
set our Type II to error to β = 0.10 in the special case that p = p1 = 0.7.
Then
√ √
zα/2 p0 q0 + zβ p1 q1 2
.
n =
p1 − p0
1.96 (0.8)(0.2) + 1.28 (0.7)(0.3) 2
p p
=
0.7 − 0.8
In order to design our test (i.e., determine its sample size), let’s set our Type I
error probability to α = 0.05.
We’d like to protect against goofing up on the poor performance side, so let’s
set our Type II to error to β = 0.10 in the special case that p = p1 = 0.7.
Then
√ √
zα/2 p0 q0 + zβ p1 q1 2
.
n =
p1 − p0
1.96 (0.8)(0.2) + 1.28 (0.7)(0.3) 2
p p
=
0.7 − 0.8
= 187.8 → 188. 2
iid iid
Suppose that X1 , X2 , . . . , Xn ∼ Bern(px ) and Y1 , Y2 , . . . , Ym ∼ Bern(py )
are two independent Bernoulli samples.
iid iid
Suppose that X1 , X2 , . . . , Xn ∼ Bern(px ) and Y1 , Y2 , . . . , Ym ∼ Bern(py )
are two independent Bernoulli samples.
Now we’re interested in testing hypotheses about the difference in the success
parameters, px − py .
iid iid
Suppose that X1 , X2 , . . . , Xn ∼ Bern(px ) and Y1 , Y2 , . . . , Ym ∼ Bern(py )
are two independent Bernoulli samples.
Now we’re interested in testing hypotheses about the difference in the success
parameters, px − py .
Two-sided test:
H0 : px = py vs. H1 : px 6= py .
iid iid
Suppose that X1 , X2 , . . . , Xn ∼ Bern(px ) and Y1 , Y2 , . . . , Ym ∼ Bern(py )
are two independent Bernoulli samples.
Now we’re interested in testing hypotheses about the difference in the success
parameters, px − py .
Two-sided test:
H0 : px = py vs. H1 : px 6= py .
By the CLT and our confidence interval work from the previous module, we
know that for large n and m,
By the CLT and our confidence interval work from the previous module, we
know that for large n and m,
px (1 − px )
X̄ ≈ Nor px ,
n
By the CLT and our confidence interval work from the previous module, we
know that for large n and m,
px (1 − px ) py (1 − py )
X̄ ≈ Nor px , and Ȳ ≈ Nor py , .
n m
By the CLT and our confidence interval work from the previous module, we
know that for large n and m,
px (1 − px ) py (1 − py )
X̄ ≈ Nor px , and Ȳ ≈ Nor py , .
n m
Then
X̄ − Ȳ − (px − py )
q ≈ Nor(0, 1).
px (1−px ) py (1−py )
n + m
By the CLT and our confidence interval work from the previous module, we
know that for large n and m,
px (1 − px ) py (1 − py )
X̄ ≈ Nor px , and Ȳ ≈ Nor py , .
n m
Then
X̄ − Ȳ − (px − py )
q ≈ Nor(0, 1).
px (1−px ) py (1−py )
n + m
By the CLT and our confidence interval work from the previous module, we
know that for large n and m,
px (1 − px ) py (1 − py )
X̄ ≈ Nor px , and Ȳ ≈ Nor py , .
n m
Then
X̄ − Ȳ − (px − py )
q ≈ Nor(0, 1).
px (1−px ) py (1−py )
n + m
X̄ − Ȳ
q ≈ Nor(0, 1).
p(1 − p) n1 + 1
m
X̄ − Ȳ
Z0 ≡ q ≈ Nor(0, 1) (under H0 ).
p̂(1 − p̂) n1 + 1
m
X̄ − Ȳ
Z0 ≡ q ≈ Nor(0, 1) (under H0 ).
p̂(1 − p̂) n1 + 1
m
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
X̄ − Ȳ
Z0 ≡ q ≈ Nor(0, 1) (under H0 ).
p̂(1 − p̂) n1 + 1
m
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
One-Sided Tests:
X̄ − Ȳ
Z0 ≡ q ≈ Nor(0, 1) (under H0 ).
p̂(1 − p̂) n1 + 1
m
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
One-Sided Tests:
H0 : px ≤ py vs. H1 : px > py
X̄ − Ȳ
Z0 ≡ q ≈ Nor(0, 1) (under H0 ).
p̂(1 − p̂) n1 + 1
m
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
One-Sided Tests:
H0 : px ≤ py vs. H1 : px > py ⇒ reject H0 iff Z0 > zα .
X̄ − Ȳ
Z0 ≡ q ≈ Nor(0, 1) (under H0 ).
p̂(1 − p̂) n1 + 1
m
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
One-Sided Tests:
H0 : px ≤ py vs. H1 : px > py ⇒ reject H0 iff Z0 > zα .
H0 : px ≥ py vs. H1 : px < py
X̄ − Ȳ
Z0 ≡ q ≈ Nor(0, 1) (under H0 ).
p̂(1 − p̂) n1 + 1
m
Thus, for the two-sided test, we reject H0 iff |Z0 | > zα/2 .
One-Sided Tests:
H0 : px ≤ py vs. H1 : px > py ⇒ reject H0 iff Z0 > zα .
H0 : px ≥ py vs. H1 : px < py ⇒ reject H0 iff Z0 < −zα .
B̄ − M̄
Z0 = q
p̂(1 − p̂) n1 + 1
m
B̄ − M̄ 0.6846 − 0.8333
Z0 = q = q = −4.135.
p̂(1 − p̂) n1 + 1
1 1
m 0.7643(0.2357) 260 + 300
B̄ − M̄ 0.6846 − 0.8333
Z0 = q = q = −4.135.
p̂(1 − p̂) n1 + 1
1 1
m 0.7643(0.2357) 260 + 300
B̄ − M̄ 0.6846 − 0.8333
Z0 = q = q = −4.135.
p̂(1 − p̂) n1 + 1
1 1
m 0.7643(0.2357) 260 + 300
Since |Z0 | > z0.025 = 1.96, we easily reject H0 , and informally declare
McWendy’s the winner. 2
At this point, let’s suppose that we’ve guessed a reasonable distribution and
then estimated the relevant parameters.
At this point, let’s suppose that we’ve guessed a reasonable distribution and
then estimated the relevant parameters. Now let’s conduct a formal test to see
just how successful our toils have been
At this point, let’s suppose that we’ve guessed a reasonable distribution and
then estimated the relevant parameters. Now let’s conduct a formal test to see
just how successful our toils have been — in other words, is our hypothesized
distribution + relevant parameters acceptable?
At this point, let’s suppose that we’ve guessed a reasonable distribution and
then estimated the relevant parameters. Now let’s conduct a formal test to see
just how successful our toils have been — in other words, is our hypothesized
distribution + relevant parameters acceptable?
At this point, let’s suppose that we’ve guessed a reasonable distribution and
then estimated the relevant parameters. Now let’s conduct a formal test to see
just how successful our toils have been — in other words, is our hypothesized
distribution + relevant parameters acceptable?
At this point, let’s suppose that we’ve guessed a reasonable distribution and
then estimated the relevant parameters. Now let’s conduct a formal test to see
just how successful our toils have been — in other words, is our hypothesized
distribution + relevant parameters acceptable?
At this point, let’s suppose that we’ve guessed a reasonable distribution and
then estimated the relevant parameters. Now let’s conduct a formal test to see
just how successful our toils have been — in other words, is our hypothesized
distribution + relevant parameters acceptable?
At this point, let’s suppose that we’ve guessed a reasonable distribution and
then estimated the relevant parameters. Now let’s conduct a formal test to see
just how successful our toils have been — in other words, is our hypothesized
distribution + relevant parameters acceptable?
5. A large value of χ20 indicates a bad fit (so just do one-sided test).
5. A large value of χ20 indicates a bad fit (so just do one-sided test).
5. A large value of χ20 indicates a bad fit (so just do one-sided test).
5. A large value of χ20 indicates a bad fit (so just do one-sided test).
5. A large value of χ20 indicates a bad fit (so just do one-sided test).
5. A large value of χ20 indicates a bad fit (so just do one-sided test).
5. A large value of χ20 indicates a bad fit (so just do one-sided test).
Remarks:
Remarks:
Usual recommendation: For the χ2 g-o-f test to work, pick k, n such that
Ei ≥ 5 for all i, and n is at least 30.
Remarks:
Usual recommendation: For the χ2 g-o-f test to work, pick k, n such that
Ei ≥ 5 for all i, and n is at least 30.
Remarks:
Usual recommendation: For the χ2 g-o-f test to work, pick k, n such that
Ei ≥ 5 for all i, and n is at least 30.
Remarks:
Usual recommendation: For the χ2 g-o-f test to work, pick k, n such that
Ei ≥ 5 for all i, and n is at least 30.
Remarks:
Usual recommendation: For the χ2 g-o-f test to work, pick k, n such that
Ei ≥ 5 for all i, and n is at least 30.
No unknown parameters, so s = 0.
Let’s get the g-o-f test statistic, χ20 . We’ll make a little table, assuming
p̂ = 0.4762 is correct.
Let’s get the g-o-f test statistic, χ20 . We’ll make a little table, assuming
p̂ = 0.4762 is correct. By the Invariance Property of MLEs (this is why we
learned it!),
Let’s get the g-o-f test statistic, χ20 . We’ll make a little table, assuming
p̂ = 0.4762 is correct. By the Invariance Property of MLEs (this is why we
learned it!), the expected number of boards having a certain value x is
Ex = nP (X = x) = n(1 − p̂)x−1 p̂ (assuming p̂ is actually p).
Let’s get the g-o-f test statistic, χ20 . We’ll make a little table, assuming
p̂ = 0.4762 is correct. By the Invariance Property of MLEs (this is why we
learned it!), the expected number of boards having a certain value x is
Ex = nP (X = x) = n(1 − p̂)x−1 p̂ (assuming p̂ is actually p).
x P (X = x) Ex Ox
Let’s get the g-o-f test statistic, χ20 . We’ll make a little table, assuming
p̂ = 0.4762 is correct. By the Invariance Property of MLEs (this is why we
learned it!), the expected number of boards having a certain value x is
Ex = nP (X = x) = n(1 − p̂)x−1 p̂ (assuming p̂ is actually p).
x P (X = x) Ex Ox
1 0.4762 33.33 34
Let’s get the g-o-f test statistic, χ20 . We’ll make a little table, assuming
p̂ = 0.4762 is correct. By the Invariance Property of MLEs (this is why we
learned it!), the expected number of boards having a certain value x is
Ex = nP (X = x) = n(1 − p̂)x−1 p̂ (assuming p̂ is actually p).
x P (X = x) Ex Ox
1 0.4762 33.33 34
2 0.2494 17.46 18
Let’s get the g-o-f test statistic, χ20 . We’ll make a little table, assuming
p̂ = 0.4762 is correct. By the Invariance Property of MLEs (this is why we
learned it!), the expected number of boards having a certain value x is
Ex = nP (X = x) = n(1 − p̂)x−1 p̂ (assuming p̂ is actually p).
x P (X = x) Ex Ox
1 0.4762 33.33 34
2 0.2494 17.46 18
3 0.1307 9.15 2
4 0.0684 4.79 9
≥ 5? 0.0753 5.27 7
1.0000 70 70
Let’s get the g-o-f test statistic, χ20 . We’ll make a little table, assuming
p̂ = 0.4762 is correct. By the Invariance Property of MLEs (this is why we
learned it!), the expected number of boards having a certain value x is
Ex = nP (X = x) = n(1 − p̂)x−1 p̂ (assuming p̂ is actually p).
x P (X = x) Ex Ox
1 0.4762 33.33 34
2 0.2494 17.46 18
3 0.1307 9.15 2
4 0.0684 4.79 9
≥ 5? 0.0753 5.27 7
1.0000 70 70
? Combine the entries in the last row (≥ 5) so the probabilities sum to one.
Well, we really ought to combine the last two cells too, since E4 = 4.79 < 5.
Well, we really ought to combine the last two cells too, since E4 = 4.79 < 5.
Let’s do so to get the following “improved” table.
Well, we really ought to combine the last two cells too, since E4 = 4.79 < 5.
Let’s do so to get the following “improved” table.
x P (X = x) Ex Ox
1 0.4762 33.33 34
2 0.2494 17.46 18
3 0.1307 9.15 2
≥4 0.1437 10.06 16
1.0000 70 70
Well, we really ought to combine the last two cells too, since E4 = 4.79 < 5.
Let’s do so to get the following “improved” table.
x P (X = x) Ex Ox
1 0.4762 33.33 34
2 0.2494 17.46 18
3 0.1307 9.15 2
≥4 0.1437 10.06 16
1.0000 70 70
Well, we really ought to combine the last two cells too, since E4 = 4.79 < 5.
Let’s do so to get the following “improved” table.
x P (X = x) Ex Ox
1 0.4762 33.33 34
2 0.2494 17.46 18
3 0.1307 9.15 2
≥4 0.1437 10.06 16
1.0000 70 70
Let k = 4 denote the number of cells (that we ultimately ended up with), and
let s = 1 denote the number of parameters we had to estimate.
Let k = 4 denote the number of cells (that we ultimately ended up with), and
let s = 1 denote the number of parameters we had to estimate.
Let k = 4 denote the number of cells (that we ultimately ended up with), and
let s = 1 denote the number of parameters we had to estimate.
Let k = 4 denote the number of cells (that we ultimately ended up with), and
let s = 1 denote the number of parameters we had to estimate.
Let k = 4 denote the number of cells (that we ultimately ended up with), and
let s = 1 denote the number of parameters we had to estimate.
Continuous Distributions:
pi = P (X ∈ Ai )
pi = P (X ∈ Ai ) = P (ai−1 < X ≤ ai )
F (ai ) = P (X ≤ ai )
F (ai ) = P (X ≤ ai ) = 1 − e−λai
Good News: We know that the MLE is λb = 1/X̄. Thus, by the Invariance
Property, the MLEs of the ai ’s are
Good News: We know that the MLE is λb = 1/X̄. Thus, by the Invariance
Property, the MLEs of the ai ’s are
1 i
ai = − `n 1 −
b
λ
b k
Good News: We know that the MLE is λb = 1/X̄. Thus, by the Invariance
Property, the MLEs of the ai ’s are
1 i i
ai = − `n 1 −
b = −X̄ `n 1 − , i = 0, 1, 2, . . . , k.
λ
b k k
Good News: We know that the MLE is λb = 1/X̄. Thus, by the Invariance
Property, the MLEs of the ai ’s are
1 i i
ai = − `n 1 −
b = −X̄ `n 1 − , i = 0, 1, 2, . . . , k.
λ
b k k
Continue the Example: We take n = 100 observations and divide them into
k = 10 equal-probability intervals, so that Ei = n/k = 10 for all i.
Good News: We know that the MLE is λb = 1/X̄. Thus, by the Invariance
Property, the MLEs of the ai ’s are
1 i i
ai = − `n 1 −
b = −X̄ `n 1 − , i = 0, 1, 2, . . . , k.
λ
b k k
Continue the Example: We take n = 100 observations and divide them into
k = 10 equal-probability intervals, so that Ei = n/k = 10 for all i. Suppose
that the sample mean based on the 100 observations is X̄ = 0.8778.
Good News: We know that the MLE is λb = 1/X̄. Thus, by the Invariance
Property, the MLEs of the ai ’s are
1 i i
ai = − `n 1 −
b = −X̄ `n 1 − , i = 0, 1, 2, . . . , k.
λ
b k k
Continue the Example: We take n = 100 observations and divide them into
k = 10 equal-probability intervals, so that Ei = n/k = 10 for all i. Suppose
that the sample mean based on the 100 observations is X̄ = 0.8778. Then
ai = −0.8778 `n 1 − 0.1i , i = 0, 1, 2, . . . , 10.
b
Good News: We know that the MLE is λb = 1/X̄. Thus, by the Invariance
Property, the MLEs of the ai ’s are
1 i i
ai = − `n 1 −
b = −X̄ `n 1 − , i = 0, 1, 2, . . . , k.
λ
b k k
Continue the Example: We take n = 100 observations and divide them into
k = 10 equal-probability intervals, so that Ei = n/k = 10 for all i. Suppose
that the sample mean based on the 100 observations is X̄ = 0.8778. Then
ai = −0.8778 `n 1 − 0.1i , i = 0, 1, 2, . . . , 10.
b
We consider the same sample of 100 iid observations from the end of the last
lesson, now with some more details.
0.9448 0.8332 0.6811 ··· 0.5635
We consider the same sample of 100 iid observations from the end of the last
lesson, now with some more details.
0.9448 0.8332 0.6811 ··· 0.5635
The sample mean for this data set is X̄ = 0.8778, and the sample standard
deviation is S = 0.3347. Here’s what the little fella looks like:
We consider the same sample of 100 iid observations from the end of the last
lesson, now with some more details.
0.9448 0.8332 0.6811 ··· 0.5635
The sample mean for this data set is X̄ = 0.8778, and the sample standard
deviation is S = 0.3347. Here’s what the little fella looks like:
In each case, we’ll divide the data into k = 10 equal-probability intervals and
perform a χ2 g-o-f test at level α = 0.05.
In each case, we’ll divide the data into k = 10 equal-probability intervals and
perform a χ2 g-o-f test at level α = 0.05.
Along the way, we’ll encounter a number of interesting issues that we’ll need
to deal with; but it’ll all work out in the end.
So this motivates our need to look at other distributions in our quest to find a
good data fit.
λr r−1 −λx
f (x) = x e , x > 0.
Γ(r)
λr r−1 −λx
f (x) = x e , x > 0.
Γ(r)
λr r−1 −λx
f (x) = x e , x > 0.
Γ(r)
λr r−1 −λx
f (x) = x e , x > 0.
Γ(r)
Way back in the good old days, we found the MLEs for r and λ:
λr r−1 −λx
f (x) = x e , x > 0.
Γ(r)
Way back in the good old days, we found the MLEs for r and λ:
λ̂ = r̂/X̄,
λr r−1 −λx
f (x) = x e , x > 0.
Γ(r)
Way back in the good old days, we found the MLEs for r and λ:
λ̂ = r̂/X̄,
where r̂ solves
n
Y
g(r) ≡ n `n(r/X̄) − nΨ(r) + `n Xi = 0,
i=1
λr r−1 −λx
f (x) = x e , x > 0.
Γ(r)
Way back in the good old days, we found the MLEs for r and λ:
λ̂ = r̂/X̄,
where r̂ solves
n
Y
g(r) ≡ n `n(r/X̄) − nΨ(r) + `n Xi = 0,
i=1
Since the digamma is sometimes a little hard to find in the usual software
packages, we’ll incorporate the approximation
. Γ(r + h) − Γ(r)
Γ0 (r) = (for any small h of your choosing).
h
Since the digamma is sometimes a little hard to find in the usual software
packages, we’ll incorporate the approximation
. Γ(r + h) − Γ(r)
Γ0 (r) = (for any small h of your choosing).
h
So we need to find r̂ that solves
n
. n Γ(r + h) Y
g(r) = n `n(r) − n `n(X̄) − − 1 + `n Xi = 0. (1)
h Γ(r)
i=1
Since the digamma is sometimes a little hard to find in the usual software
packages, we’ll incorporate the approximation
. Γ(r + h) − Γ(r)
Γ0 (r) = (for any small h of your choosing).
h
So we need to find r̂ that solves
n
. n Γ(r + h) Y
g(r) = n `n(r) − n `n(X̄) − − 1 + `n Xi = 0. (1)
h Γ(r)
i=1
Since the digamma is sometimes a little hard to find in the usual software
packages, we’ll incorporate the approximation
. Γ(r + h) − Γ(r)
Γ0 (r) = (for any small h of your choosing).
h
So we need to find r̂ that solves
n
. n Γ(r + h) Y
g(r) = n `n(r) − n `n(X̄) − − 1 + `n Xi = 0. (1)
h Γ(r)
i=1
Since the digamma is sometimes a little hard to find in the usual software
packages, we’ll incorporate the approximation
. Γ(r + h) − Γ(r)
Γ0 (r) = (for any small h of your choosing).
h
So we need to find r̂ that solves
n
. n Γ(r + h) Y
g(r) = n `n(r) − n `n(X̄) − − 1 + `n Xi = 0. (1)
h Γ(r)
i=1
Since the digamma is sometimes a little hard to find in the usual software
packages, we’ll incorporate the approximation
. Γ(r + h) − Γ(r)
Γ0 (r) = (for any small h of your choosing).
h
So we need to find r̂ that solves
n
. n Γ(r + h) Y
g(r) = n `n(r) − n `n(X̄) − − 1 + `n Xi = 0. (1)
h Γ(r)
i=1
Let’s take the approximate differentiation term h = 0.01. Then here’s what
Equation (1) simplifies to:
Let’s take the approximate differentiation term h = 0.01. Then here’s what
Equation (1) simplifies to:
Let’s take the approximate differentiation term h = 0.01. Then here’s what
Equation (1) simplifies to:
In order to initialize the bisection algorithm, we note that g(5) = 0.5506 and
g(7) = −3.0595. So there’s a zero in there somewhere just itching to be
found!
Let’s take the approximate differentiation term h = 0.01. Then here’s what
Equation (1) simplifies to:
In order to initialize the bisection algorithm, we note that g(5) = 0.5506 and
g(7) = −3.0595. So there’s a zero in there somewhere just itching to be
found!
Sadly, gamma distribution’s cdf doesn’t have a closed-form. But that’s why
we have Excel (or its friends) around, e.g.,
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
x ≥ 0.
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
Let’s get MLEs for the s = 2 unknown parameters (r and λ). After a little
algebra (a couple of chain rules), the pdf is
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
Let’s get MLEs for the s = 2 unknown parameters (r and λ). After a little
algebra (a couple of chain rules), the pdf is
r
f (x) = λr(λx)r−1 e−(λx) , x ≥ 0.
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
Let’s get MLEs for the s = 2 unknown parameters (r and λ). After a little
algebra (a couple of chain rules), the pdf is
r
f (x) = λr(λx)r−1 e−(λx) , x ≥ 0.
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
Let’s get MLEs for the s = 2 unknown parameters (r and λ). After a little
algebra (a couple of chain rules), the pdf is
r
f (x) = λr(λx)r−1 e−(λx) , x ≥ 0.
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
Let’s get MLEs for the s = 2 unknown parameters (r and λ). After a little
algebra (a couple of chain rules), the pdf is
r
f (x) = λr(λx)r−1 e−(λx) , x ≥ 0.
Weibull: The Weibull distribution has cdf F (x) = 1 − exp − (λx)r , for
Let’s get MLEs for the s = 2 unknown parameters (r and λ). After a little
algebra (a couple of chain rules), the pdf is
r
f (x) = λr(λx)r−1 e−(λx) , x ≥ 0.
n
Y n
X
r
`n(L) = nr `n(λ) + n `n(r) + (r − 1) `n xi − λ xri .
i=1 i=1
∂ ∂
`n(L) = 0 and `n(L) = 0.
∂r ∂λ
∂ ∂
`n(L) = 0 and `n(L) = 0.
∂r ∂λ
d x
After more algebra — including the fact that dx c = cx `n(c) — we get the
simultaneous equations
∂ ∂
`n(L) = 0 and `n(L) = 0.
∂r ∂λ
d x
After more algebra — including the fact that dx c = cx `n(c) — we get the
simultaneous equations
n
1 X −1/r
λ = xri and
n
i=1
∂ ∂
`n(L) = 0 and `n(L) = 0.
∂r ∂λ
d x
After more algebra — including the fact that dx c = cx `n(c) — we get the
simultaneous equations
n
1 X −1/r
λ = xri and
n
i=1
n n P xr `n(x )
n Y
i i i
g(r) = + `n xi − P r = 0.
r x
i i
i=1
The equation for λ looks easy enough, if only we could solve for r!
The equation for λ looks easy enough, if only we could solve for r!
But we can! Let’s use Newton’s method. It’s usually a lot faster than
bisection.
The equation for λ looks easy enough, if only we could solve for r!
But we can! Let’s use Newton’s method. It’s usually a lot faster than
bisection. Here’s a reasonable implementation of Newton.
The equation for λ looks easy enough, if only we could solve for r!
But we can! Let’s use Newton’s method. It’s usually a lot faster than
bisection. Here’s a reasonable implementation of Newton.
1 Initialize r0 = X̄/S, where X̄ is the sample mean and S 2 is the sample
variance. Set j ← 0.
The equation for λ looks easy enough, if only we could solve for r!
But we can! Let’s use Newton’s method. It’s usually a lot faster than
bisection. Here’s a reasonable implementation of Newton.
1 Initialize r0 = X̄/S, where X̄ is the sample mean and S 2 is the sample
variance. Set j ← 0.
2 Update rj+1 ← rj − g(rj )/g 0 (rj ).
The equation for λ looks easy enough, if only we could solve for r!
But we can! Let’s use Newton’s method. It’s usually a lot faster than
bisection. Here’s a reasonable implementation of Newton.
1 Initialize r0 = X̄/S, where X̄ is the sample mean and S 2 is the sample
variance. Set j ← 0.
2 Update rj+1 ← rj − g(rj )/g 0 (rj ).
3 If |g(rj+1 )| or |rj+1 − rj | or your budget is suitably small, then STOP
and set the MLE r̂ ← rj+1 .
The equation for λ looks easy enough, if only we could solve for r!
But we can! Let’s use Newton’s method. It’s usually a lot faster than
bisection. Here’s a reasonable implementation of Newton.
1 Initialize r0 = X̄/S, where X̄ is the sample mean and S 2 is the sample
variance. Set j ← 0.
2 Update rj+1 ← rj − g(rj )/g 0 (rj ).
3 If |g(rj+1 )| or |rj+1 − rj | or your budget is suitably small, then STOP
and set the MLE r̂ ← rj+1 . Otherwise, let j ← j + 1 and goto Step 2.
The equation for λ looks easy enough, if only we could solve for r!
But we can! Let’s use Newton’s method. It’s usually a lot faster than
bisection. Here’s a reasonable implementation of Newton.
1 Initialize r0 = X̄/S, where X̄ is the sample mean and S 2 is the sample
variance. Set j ← 0.
2 Update rj+1 ← rj − g(rj )/g 0 (rj ).
3 If |g(rj+1 )| or |rj+1 − rj | or your budget is suitably small, then STOP
and set the MLE r̂ ← rj+1 . Otherwise, let j ← j + 1 and goto Step 2.
i 1/r̂
1
âi = −`n 1 −
λ
b k
= 0.9854 [−`n(1 − 0.1 i)]0.3496 , i = 0, 1, 2, . . . , 10.
i 1/r̂
1
âi = −`n 1 −
λ
b k
= 0.9854 [−`n(1 − 0.1 i)]0.3496 , i = 0, 1, 2, . . . , 10.
i 1/r̂
1
âi = −`n 1 −
λ
b k
= 0.9854 [−`n(1 − 0.1 i)]0.3496 , i = 0, 1, 2, . . . , 10.
i 1/r̂
1
âi = −`n 1 −
λ
b k
= 0.9854 [−`n(1 − 0.1 i)]0.3496 , i = 0, 1, 2, . . . , 10.