Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

MAT3026 - Probability and Statistics

Lecture 13 - Confidence Intervals (I)


Chapter 9 in Walpole

§ Classical Methods of Estimation Walpole 9.3

§ Single Sample: Estimating the Mean (µ) Walpole 9.4


§ Paired Observations (µd) Walpole 9.9

MAT3026 Lecture 13 1
9.3 Interval estimation / 9.4 Single Sample: Estimating the Mean
An interval estimate of a population parameter, for example the population
mean  , is an interval of the form ; that is the population mean
is estimated to be between lower and upper limits.

Sampling provides us with a point estimate of the population mean  ; this


is our best guess and so we can place it at the center of the interval estimate.

We can then define the lower and upper limits by considering our
understanding how the sample mean is distributed...

MAT3026 Lecture 12 2
Distribution of
sample mean.
1-
probability
1- probability interval

1-
confidence
1- confidence interval

MAT3026 Lecture 12 3
The value 1- is no longer a probability; instead, we say that we are 100(1−α)%
confident that the interval will contain . Thus, when α = 0.05, we have a 95%
confidence interval (5% significance level), and when α = 0.01, we obtain a
wider 99% confidence interval (1% significance level).

Alternative ways
to express the
same interval
or
1-
confidence 1 - α is the level of confidence
α is the level of significance
e = error in the estimate of the mean

MAT3026 Lecture 12 4
To determine the confidence limits we need to find the value of z that leaves an
area /2 to the right (and –z that leaves the same area to the left):

1–

MAT3026 Lecture 12 5
To determine the confidence limits we need to find the value of z that leaves an
area /2 to the right (and –z that leaves the same area to the left):

1 –  = 95%
2.5% 2.5%

-1.96 +1.96

MAT3026 Lecture 12 5
The meaning of Confidence
Different samples will yield different values of and therefore produce
different interval estimates for the parameter μ.
estimate of μ Given that  is known, the size of the error
bar is the same for each sample:
error in the
estimate

The figure shows 90% confidence


intervals; this means that we would
expect 90% of the interval estimates to
include the population parameter.
e e http://stattrek.com/estimation/confidence-interval.aspx

Note that increasing the sample size, n,


The true for the same confidence, will decrease
population the error of the measurement.
mean

MAT3026 Lecture 12 6
Example
The average zinc concentration calculated from 36 measurements in a
reservoir is found to be 2.60 mg/L. If the population standard deviation is
known to be 0.30 mg/L, find the 90% confidence interval for the population
mean zinc concentration in the reservoir.
Solution
The point estimate of  is 1 -  = 0.90  /2 = 0.050
the standard deviation is
The z value can be found by solving:
and the simple size n = 36

We wish to form the interval: And so

or

We are 90% confident that the mean zinc concentration lies between 2.52 and 2.68 mg/L.

MAT3026 Lecture 12 7
More intervals

90% confidence interval: 5.0% 90% 5.0%

2.52 2.60 2.68

2.5% 95% 2.5%


95% confidence interval:
2.50 2.60 2.70

99% confidence interval: 0.5% 99% 0.5%

2.47 2.60 2.73

We are 95% confident that the mean zinc


concentration lies between 2.50 and 2.70 mg/L.
MAT3026 Lecture 12 8
One-Sided Confidence Bounds
We may wish to build confidence intervals that are one-sided:

Lower one-sided bound on . Upper one-sided bound on .

Here, is the z-value that leaves an area  to the right and therefore
an area 1- to the left.

MAT3026 Lecture 12 9
Example
The average zinc concentration calculated from 36 measurements in a
reservoir is found to be 2.6 mg/L. If the population standard deviation is
known to be 0.3 mg/L, find the 95% upper bounded confidence interval for
the population mean zinc concentration in the reservoir.
Solution
The point estimate of  is ,
the standard deviation is
and the sample size n = 36
We wish to form interval: and so the 95% upper bounded
confidence interval is:

with 1 -  = 0.95   = 0.05


We are 95% confident that the average
zinc concentration is less than 2.68 mg/L

MAT3026 Lecture 12 10
Above 5 mg/L, water tastes bad! but zinc is good for you;  10 mg/day (but < 25 mg/day!)

More intervals

90% confidence interval 10%

2.60 2.66

95% confidence interval 5%

2.60 2.68

99% confidence interval 1%

2.60 2.72

We are 99% confident that the mean zinc concentration is less than 2.72 mg/L.

MAT3026 Lecture 12 11
The Case of Unknown σ
If the population standard deviation  is unknown then we need to estimate 
(by calculating s) and use tcdf(t, ) instead of normcdf(z).

Having to estimate  means that there is more uncertainty and so confidence


intervals are wider! But this is only significant if the sample size is small (n<<30).

MAT3026 Lecture 12 12
Example (from Lecture 1)

100,000 iron ingots. A sample of 19 ingots.

www.haotianmetal.net

0.990 0.995 1.000 1.005 1.010


Ingot mass (kg)

Construct a 95% confidence interval for the population mean mass of an iron.

MAT3026 Lecture 12 13
Solution
989.644
993.317
994.810
995.236
996.824
996.848
998.246
998.744
999.312
1000.071
1001.161
1001.327
1001.824
1003.056
1003.246
1003.791
1005.853 2.5% 2.5%
1009.360 (g)
1010.710 997.6 1000.2 1002.7

We are 95% confident that the mean mass of the our


population of iron ingots is between 997.6 and 1002.7 g

MAT3026 Lecture 12 14
> m = 152.35; s=10.53; n=10;
> X = m + trnd(n-1,1e6,1)*s/sqrt(n);
> sum(X>146.2)/1e6  95.1%

Example: Tesla claims that their electric cars have an average range of 155 miles after being
supercharged for only 20 minutes. A Tesla owner decides to test this claim; she samples the
range of her car ten times and determines the sample mean range to be 152.35 miles with
a sample standard deviation of 10.53 miles. Since the observation is less than Tesla’s claim,
she decides to find the lower bound that represents a 95% confidence:

v = n – 1 = 10 – 1 = 9
One-sided lower bound 95%
1 -  = 95%
confidence interval   = 0.05
 t0.05 = 1.833
  = 152.35 - 1.833  10.53/ 10
= 146.2 miles  = 5%
The owner is 95% confident that the
mean range is greater than 146 miles.
95% c.i.

MAT3026 Lecture 12 15
9.9 Paired Observations
Confidence Interval for μd for Paired Observations
For a collection of sample points X, the confidence interval for x is:

If observations are paired, then the confidence interval for the mean of the
differences of each pair, d is:
This is appropriate if we are
interested in the changes B  A.
Note that we are dealing with only
one population here; this is not the
same as the difference between
the means of two populations.

MAT3026 Lecture 12 16
Example
Ten vehicles are tested for CO2 emissions before (B) and after (A) an engine
modification. Form a 95% confidence interval for the mean difference A-B and
comment on the significance of the engine modification.
CO2 Emissions (mg/km)
Solution
B A A-B 95% confidence  /2 = 0.025
528 523 -5  = n – 1 = 10 – 1 = 9  t0.025 = 2.262
479 475 -4
484 478 -6
517 511 -6
481 466 -15
493 482 -11
505 496 -9
494 482 -12
515 509 -6
513 499 -14
m = -8.80
s = 3.97

MAT3026 Lecture 12 17
Illustration for the previous example
(before) (after)

Clearly, there is a downward trend for the


emissions after the engine modification.

95% confidence interval

MAT3026 Lecture 12 18
Summary

Paired (Before and After) observations

More examples …

MAT3026 Lecture 12 19
Confidence interval for  (one sided)

Example
A sample of 30 batteries are tested for the time to charge to 90% capacity.
The result gives a sample mean of 42.0 minutes with a sample standard
deviation of 3.4 minutes. Construct an upper-bounded 99% confidence
interval for the mean charging time.

Solution
= 42.0 minutes,
s = 3.4 minutes,
n = 30   = 29  < 42.0 + 2.462 ( 3.4/30 )
  < 42.0 + 1.5283
1- = 0.99   = 0.01
  < 43.5 minutes with 99% confidence
tcdf(t0.01, =29) = 0.99
 t0.01 = 2.462

MAT3026 Lecture 12 20
Confidence interval for  (two sided)

Example
A random sample of 12 shearing pins is taken in a study of the Rockwell
hardness of the pins. Measurements yield an average value of 48.50 with a
sample standard deviation of 1.5.
Construct a 90% confidence interval for the mean Rockwell hardness.

Solution
= 12, = 48.50 , = 1.5
We need to build a 90% confidence interval  (1-) = 0.90   = 0.10  /2 = 0.05.
Both the mean and standard devation is sampled  we find a t0.05 value with  = 11.
tcdf(1.796,11) = 0.9500

48.50 − (1.796)(1.5/√12) < μ < 48.50 + (1.796)(1.5/√12)


48.50 - 0.7777 < μ < 48.50 + 0.7777
47.7223 < μ < 49.2777
47.7 < μ < 49.3 with 90% confidence

MAT3026 Lecture 12 21
Confidence interval for d (paired)

Example
The ranges of seven electric vehicles are measured before a software upgrade
and then again after the software upgrade is applied. The results are shown in
the table below. Calculate the 95% confidence interval for the mean change in
vehicle range.
Vehicle 1 2 3 4 5 6 7
Range before (km) 642 624 611 688 674 633 668
Range after (km) 738 767 761 776 778 772 782

Solution
Use pairing n=7  =6
1- = 0.95  /2 = 0.025
tcdf(t0.025, =6) = 0.975
 t0.025 = 2.447

MAT3026 Lecture 12 22
n=7, t0.025 = 2.447

Vehicle 1 2 3 4 5 6 7
Range before (km) 642 624 611 688 674 633 668
Range after (km) 738 767 761 776 778 772 782
d 96 143 150 88 104 139 114

 d = 834;  d2 = 103042; mean d = 834/7 = 119.14


sd2 = [7x103042 - 8342]/7/6 = 612.8095  sd = 24.755

119.14 - 2.447(24.755/7) < d < 119.14 + 2.447(24.755/7)


96.2 < d < 142.0 km with 95% confidence

MAT3026 Lecture 12 23
Homework
Review today’s lecture notes
they can be found on the course website.
Reading - read Walpole Sections
9.3 Classical Methods of Estimation
9.4 Single Sample: Estimating the Mean
9.9 Paired Observations

Exercises - can be found on the course website.

http://stattrek.com/online-calculator/normal.aspx
http://stattrek.com/online-calculator/t-distribution.aspx
https://akademik.bahcesehir.edu.tr/~beddall/MAT3026/cdf.html

MAT3026 Lecture 12 24

You might also like