You are on page 1of 25

Session 16 References

Probability and Statistical Course.

Instructor: Dr.Ing. Sergio A. Abreo C.

Escuela de Ingenierías Eléctrica, Electrónica y de Telecomunicaciones

Universidad Industrial de Santander

Marzo 18, 2020

Connectivity and Signal Processing Research Group.


info@cps.uis.edu.co http://cps.uis.edu.co/index.php

1 / 25
Session 16 References

Agenda

1 Session 16
Confidence Interval

2 References

2 / 25
Session 16 References

CI on the mean of a normal distribution: variance unknown

The t distribution
Let X1 , X2 , .., Xn be a random sample from a normal distribution
with unknown mean µ and unknown variance σ 2 . The random
variable
X̄ − µ
T = √
S/ n
has a t distribution with n − 1 degrees of freedom.
The general appearance of the t distribution is similar to the
standard normal distribution in that both distributions are
symmetric and unimodal, and the maximum ordinate value is
reached when the mean µ = 0.
However, the t distribution has heavier tails than the normal.

3 / 25
Session 16 References

CI on the mean of a normal distribution: variance unknown

Definition
If x̄ and s are the mean and the standard deviation of a random
sample from a normal distribution with unknown variance σ 2 , a
100(1 − α)% CI on µ is given by
s s
x̄ − tα/2,n−1 √ ≤ µ ≤ x̄ + tα/2,n−1 √
n n

where tα/2,n−1 is the upper 100α/2 percentage point of the t


distribution with n − 1 degrees of freedom.

4 / 25
Session 16 References

CI on σ 2

Definition
If s 2 is the sample variance from a random sample of n
observations from a normal distribution with unknown variance σ 2 ,
then a 100(1 − α)% confidence interval on σ 2 is

(n − 1)s 2 2 (n − 1)s 2
≤ σ ≤
χ2α/2,n−1 χ21−α/2,n−1

where χ2α/2,n−1 and χ21−α/2,n−1 are the upper and lower 100α/2
percentage points of the chi-square distribution with n − 1 degrees
of freedom, respectively. A confidence interval for σ has lower and
upper limits that are the square roots of the corresponding limits.

5 / 25
Session 16 References

CI on σ 2

Chi-squared distribution
Let X1 , X2 , .., Xn be a random sample from a normal distribution
with mean µ and variance σ 2 , and let S 2 be the sample variance.
Then the random variable
(n − 1)S 2
X2 =
σ2
has a chi-square (χ2 ) distribution with n − 1 degrees of freedom.

6 / 25
Session 16 References

Test of Hypotheses for a single sample

Hypotheses
In the previous sesion we illustrated how to construct a
confidence interval estimate of a parameter from sample data.
However, many problems in engineering require that we decide
whether to accept or reject a statement about some
parameter.
The statement is called a hypothesis, and the decision-making
procedure about the hypothesis is called hypothesis testing.
Statistical hypothesis testing and confidence interval
estimation of parameters are the fundamental methods used
at the data analysis stage of a comparative experiment.
A statistical hypothesis is a statement about the parameters
of one or more populations.

7 / 25
Session 16 References

Test of Hypotheses for a single sample

Example
Suppose that we are interested in the burning rate of a solid
propellant used to power aircrew escape systems.
Now burning rate is a random variable that can be described
by a probability distribution.
Suppose that our interest focuses on the mean burning rate.
Specifically, we are interested in deciding whether or not the
mean burning rate is 50 centimeters per second.
We may express this formally as:
H0 : µ = 50 centimeters per second. Null Hypothesis.
H1 : µ 6= 50 centimeters per second. Two-sided alternative
Hypothesis

8 / 25
Session 16 References

Test of Hypotheses for a single sample

Example
Or
H0 : µ = 50 centimeters per second. Null Hypothesis.
H1 : µ < 50 centimeters per second. One-sided alternative
Hypothesis
Or
H0 : µ = 50 centimeters per second. Null Hypothesis.
H1 : µ > 50 centimeters per second. One-sided alternative
Hypothesis
It is important to remember that hypotheses are always
statements about the population or distribution under study,
not statements about the sample.

9 / 25
Session 16 References

Test of Hypotheses for a single sample

Statistical test
The null hypothesis is the hypothesis we wish to test.
Rejection of the null hypothesis always leads to accepting the
alternative hypothesis.
The null hypothesis will always be stated so that it specifies
an exact value of the parameter.
Testing the hypothesis involves taking a random sample,
computing a test statistic from the sample data, and then
using the test statistic to make a decision about the null
hypothesis.
Hypothesis-testing procedures rely on using the information in
a random sample from the population of interest.

10 / 25
Session 16 References

Test of Hypotheses for a single sample

Statistical test
If this information is consistent with the hypothesis, we will
conclude that the hypothesis is true.
However, if this information is inconsistent with the
hypothesis, we will conclude that the hypothesis is false.
We emphasize that the truth or falsity of a particular
hypothesis can never be known with certainty, unless we can
examine the entire population.
Therefore, a hypothesis-testing procedure should be developed
with the probability of reaching a wrong conclusion in mind.

11 / 25
Session 16 References

Test of Hypotheses for a single sample

Type I error
Rejecting the null hypothesis H0 when it is true.

Type II error
Failing to reject the null hypothesis when it is false.

Figure 1 : Taken from [Montgomery and Runger, 2010]


12 / 25
Session 16 References

Test of Hypotheses for a single sample


Type I: α = P(reject H0 when H0 is true)

Figure 2 : Taken from [Montgomery and Runger, 2010]

α = P(X̄ < 48.5 when µ = 50) + P(X̄ > 51.5 when µ = 50) =
0.028717 + 0.028717 = 0.057434. This implies that 5.76% of all
random samples would lead to rejection of the hypothesis null.
13 / 25
Session 16 References

Test of Hypotheses for a single sample

Type II: β = P(fail to reject H0 when H0 is false)

Figure 3 : Taken from [Montgomery and Runger, 2010]

β = P(48.5 ≤ X̄ ≤ 51.5 when µ = 52) = 0.2643.

14 / 25
Session 16 References

Test of Hypotheses for a single sample


Type II: β = P(fail to reject H0 when H0 is false)

Figure 4 : Taken from [Montgomery and Runger, 2010]

The probability of making a type II error β increases rapidly as the


true value of µ approaches the hypothesized value.
15 / 25
Session 16 References

Test of Hypotheses for a single sample


Type II: β = P(fail to reject H0 when H0 is false)

Figure 5 : Taken from [Montgomery and Runger, 2010]

β = P(48.5 ≤ X̄ ≤ 51.5 when µ = 50.5) = 0.8923.

16 / 25
Session 16 References

Test of Hypotheses for a single sample


Error behaviour

Figure 6 : Taken from [Montgomery and Runger, 2010]

Strong and Weak conclusion


Since the analyst can directly control the probability of
wrongly rejecting H0 , we always think of rejection of the null
hypothesis H0 as a strong conclusion.
It is customary to think of the decision to accept H0 as a
weak conclusion.
17 / 25
Session 16 References

Test of Hypotheses for a single sample


Summary
1 The size of the critical region, and consequently the
probability of a type I error, can always be reduced by
appropriate selection of the critical values.
2 Type I and type II errors are related. A decrease in the
probability of one type of error always results in an increase in
the probability of the other, provided that the sample size n
does not change.
3 An increase in sample size will generally reduce both α and β,
provided that the critical values are held constant.
4 When the null hypothesis is false, β increases as the true
value of the parameter approaches the value hypothesized in
the null hypothesis. The value of β decreases as the difference
between the true mean and the hypothesized value increases.
18 / 25
Session 16 References

Test of Hypotheses for a single sample

Power
The power of a statistical test is the probability of rejecting
the null hypothesis H0 when the alternative hypothesis is true.
The power is computed as 1 − β, and power can be interpreted
as the probability of correctly rejecting a false null hypothesis.
When H0 : µ = 50 and H1 : µ 6= 50. Suppose that the true
value of the mean is µ = 52.
When n = 10, we found that β = 0.2643, so the power of this
test is 1 − β = 1 − 0.2643 = 0.7357 when µ = 52.
If the true mean is really 52 centimeters per second, this test
will correctly reject H0 : µ = 50 and “detec” this difference
73.57% of the time.

19 / 25
Session 16 References

Test of Hypotheses for a single sample

General Procedure for Hypothesis Tests


1 From the problem context, identify the parameter of interest.
2 State the null hypothesis, H0 .
3 Specify an appropriate alternative hypothesis, H1 .
4 Choose a significance level α.
5 Determine an appropriate test statistic.
6 State the rejection region for the statistic.
7 Compute any necessary sample quantities, substitute these
into the equation for the test statistic, and compute that
value.
8 Decide whether or not H0 should be rejected and report that
in the problem context.

20 / 25
Session 16 References

Test of Hypotheses for a single sample

Statements
Are the following statements correct?
H0 : µ = 25, H1 : µ 6= 25
H0 : σ > 10, H1 : σ = 10
H0 : x̄ = 50, H1 : x̄ 6= 50
H0 : p = 0.1, H1 : p = 0.5
H0 : s = 30, H1 : s > 30

21 / 25
Session 16 References

Test of Hypotheses for a single sample

Exercise 1
The heat evolved in calories per gram of a cement mixture is
approximately normally distributed. The mean is thought to be
100 and the standard deviation is 2. We wish to test H0 : µ = 100
versus H1 : µ 6= 100 with a sample of n = 9 specimens.
If the acceptance region is defined as 98.5 ≤ x ≤ 101.5, find
the type I error probability α.
Find β for the case where the true mean heat evolved is 103.
Find β for the case where the true mean heat evolved is 105.
This value of β is smaller than the one found before. Why?

22 / 25
Session 16 References

Test of Hypotheses for a single sample

Exercise 2
Assume that the type II error can be computed as
185 − µ
β = P(z ≤ √ )
20/ 10

.
Compute β and the power for the µ values
{178, 181, 184, 187, 190, 193, 196, 199}
Plot β vs. µ.
Plot the power vs. µ.
What can be concluded from both graphics?

23 / 25
Session 16 References

Test of Hypotheses

Matlab exercise. Please explain the code.


1 load gas
2 prices = [ price1 price2 ] ;
3 normplot ( p r i c e s )
4 l i l l i e t e s t ( price1 )
5 l i l l i e t e s t ( price2 )
6 sample_means = mean ( p r i c e s )
7 [ h , pvalue , c i ] = z t e s t ( p r i c e 1 /100 ,1.15 ,0.04)
8 [ h , pvalue , c i ] = t t e s t ( p r i c e 2 /100 ,1.15)
9 [ h , sig , ci ] = ttest2 ( price1 , price2 )
10 boxplot ( prices ,1)
11 h = gca ;
12 h . XTick = [ 1 2 ] ;
13 h . XTickLabel = { ’ January ’ , ’ February ’ };
14 x l a b e l ( ’ Month ’ )
15 y l a b e l ( ’ P r i c e s ( $0 . 0 1 ) ’ )

24 / 25
Session 16 References

References I

Montgomery, D. C. and Runger, G. C. (2010).


Applied statistics and probability for engineers.
John Wiley & Sons.

25 / 25

You might also like