4up PDF

advertisement
The Normal Distribution
• The Normal Distribution (AKA Gaussian Distribution) is our
first distribution for continuous variables and is the most
commonly used distribution.
• The normal density curve is the famous symmetric, bellshaped curve.
Probability Density
0.4
Central Limit Theorem
These facts are the basis for most of the methods of statistical
inference we will study in the last half of the course.
• Chapter 4 introduces the normal distribution as a probability
distribution.
• Chapter 5 culminates in the central limit theorem, the
primary theoretical justification for most of the methods of
statistical inference in the remainder of the textbook.
0.2
0.0
Statistics 371
1
Statistics 371
3
Central Limit Theorem
The Normal Distribution
Why is it such an important distribution? Two related reasons:
Mary Lindstrom
1. The central limit theorem states that many statistics we
calculate from large random samples will have approximate
normal distributions (or distributions derived from normal
distributions), even if the distributions of the underlying
variables are not normally distributed.
(Adapted from notes provided by Professor Bret Larget)
February 10, 2004
2. Many measured variables nave approximately normal distributions. This is true because most things we measure are
the sum of many smaller units and the central limit theorem
applies.
Statistics 371
Last modified: February 11, 2004
Statistics 371
2
Probability Density
If Y is a normally distributed Random Variable
All normal curves have the same shape so that every normal
curve can be drawn in exactly the same manner, just by changing
labels on the axis (this is not true for the Binomial or Poisson
distributions).
Standardization
Standard Shape
Normal Distribution
mu = 100 , sigma = 3
90
95
100
105
Probability Density
110
−40
Normal Distribution
−40
−30
−20
−10
0
mu = 2 , sigma = 10
0
20
−2
0
2
4
Statistics 371
5
Statistics 371
7
For every normal curve,
Normal curves have the following bell-shaped, symmetric density.
The 68–95–99.7 Rule
The Normal Density
1
−1
f (y) = √ e 2
σ 2π
Y ∼ N(µ, σ 2)
And we define
Y −µ
σ
Then Z is a standard normal random variable
40
mu = 0 , sigma = 1
−4
Z=
Normal Distribution
Z ∼ N(0, 1)
−20
Every problem that asks for an area under a normal curve is
solved by first finding an equivalent problem for the standard
normal curve.
Normal Distribution
mu = −20 , sigma = 5
Probability Density
Probability Density
• 68% of the area is within one SD of the mean,
• 95% of the area is within two SDs of the mean,
• 99.7% of the area is within three SDs of the mean.
y−µ 2
σ
Parameters: The parameters of a normal curve are the mean µ
and the standard deviation σ.
Probability Density
Normal Distribution
Y ∼ N(µ, σ 2)
Normal Distribution
mu = 0 , sigma = 1
−4
−2
0
2
−3
−2
−1
0
1
2
0
P( X > 1 ) = 0.1587
0
2
2
4
mu = 0 , sigma = 1
P( −3 < X < 3 ) = 0.9973
P( X < −3 ) = 0.0013
−4
−2
P( X > 3 ) = 0.0013
0
2
Statistics 371
4
4
Normal Distribution
mu = 0 , sigma = 1
P( X > 2 ) = 0.0228
−2
−2
3
Normal Distribution
P( −2 < X < 2 ) = 0.9545
P( X < −2 ) = 0.0228
−4
mu = 0 , sigma = 1
P( −1 < X < 1 ) = 0.6827
P( X < −1 ) = 0.1587
4
−4
If Y is a normally distributed Random Variable with mean µ and
standard deviation σ, then we write:
Probability Density
Statistics 371
Probability Density
Probability Density
4
6
Probability Density
If you don’t have R handy, the way to do this is to transform it
into a question about a standard normal distribution.
Suppose that egg shell thickness is normally distributed with a
mean of 0.381 mm and a standard deviation of 0.031 mm.
Example Calculation
Example Calculation
Find the proportion of eggs with shell thickness less than 0.34
mm.
1. We define our random variable Y = egg shell thickness.
2. We know that
Y ∼ N(0.381, 0.0312 )
3. We wish to know
Pr{Y < 0.34}
9
Pr{Y < 0.34} = Pr{Y − 0.381 < 0.34 − 0.381}
= Pr{[Y − 0.381]/0.031 < [0.34 − 0.381]/0.031}
= Pr{Z < −1.322}
Where Z is a standard normal random variable: Z ∼ N(0, 1).
Statistics 371
Statistics 371
Normal Distribution
P( X > 1 ) = 0.1587
−3
−2
0
−2
−1
0
1
2
2
0
−2
−1
10
−1
0
12
1
0
1
2
11
mu = 0.381 , sigma = 0.031
5
2
3
mu = 5 , sigma = 4
P( X > 11 ) = 0.1587
8
−2
Here is a way to do it in R.
P( −3 < X < 1 ) = 0.6827
P( X > 1 ) = 0.1587
−5
−3
Normal Distribution
mu = 10 , sigma = 1
P( 9 < X < 11 ) = 0.6827
P( X < 9 ) = 0.1587
6
−3
> source("prob.R")
> gnorm(0.381, 0.031, b = 0.34)
P( X < −3 ) = 0.1587
Normal Distribution
4
3
Normal Distribution
Probability Density
This is exactly the type probability tabulated in a standard normal
table
Example Calculation
Standardization
mu = −1 , sigma = 2
mu = 0 , sigma = 1
Normal Distribution
P( −1 < X < 1 ) = 0.6827
P( X < −1 ) = 0.1587
−4
Probability Density
Probability Density
14
Probability Density
P( 1 < X < 9 ) = 0.6827
P( X < 1 ) = 0.1587
P( X > 9 ) = 0.1587
−10
3
−5
−3
0
−2
−1
5
10
0
1
15
2
P( X < 0.34 ) = 0.093
P( X > 0.34 ) = 0.907
20
3
0.25
0.30
−3
Statistics 371
8
−2
0.35
−1
0.40
0
1
0.45
2
0.50
3
Statistics 371
10
Standard Normal table
Here is a portion of the table on the inside cover of your book:
-1.4
-1.3
-1.2
-1.1
-1.0
0
0.0808
0.0968
0.1151
0.1357
0.1587
.01
0.0793
0.0951
0.1131
0.1335
0.1562
.02
0.0778
0.0934
0.1112
0.1314
0.1539
.03
0.0764
0.0918
0.1093
0.1292
0.1515
We want the area to the left of −1.322
•
•
•
•
we round to −1.32
look up −1.3 in the row labels on the left
look up .02 in the column labels
to find P (Z < −1.32) = 0.0934.
Statistics 371
Probability Density
Example Area Calculations: Area to the
left
Find the proportion of eggs with shell thickness less than 0.34
mm.
> pnorm(q = 0.34, mean = 0.381, sd = 0.031)
[1] 0.09298744
> gnorm(0.381, 0.031, b = 0.34, sigma.axis = F)
Normal Distribution
mu = 0.381 , sigma = 0.031
P( X < 0.34 ) = 0.093
P( X > 0.34 ) = 0.907
0.25
0.35
0.45
Pr{Y < 0.34} = Pr{[Y − 0.381]/0.031 < [0.34 − 0.381]/0.031}
= Pr{Z < −1.322} = 0.0934
13
Statistics 371
Standard Normal table
15
Standard Normal table
• The standard normal table lists the area to the left of z under
the standard normal curve for each value from −3.49 to 3.49
by 0.01 increments.
• R can do this for general values of z
• and R can do the standardization for you.
• The normal table is on the inside front cover of your
textbook.
• Recall that our original question was given Y ∼ N(0.381, 0.0312 )
what is Pr{Y < 0.34}.
• Numbers in the margins represent z.
• Numbers in the middle of the table are areas to the left of z.
Probability Density
mu = 0.381 , sigma = 0.031
mu = 0 , sigma = 1
Normal Distribution
Normal Distribution
P( X < −1.322 ) = 0.0931
P( X > −1.322 ) = 0.9069
−4
−2
0
2
Probability Density
4
P( X < 0.34 ) = 0.093
P( X > 0.34 ) = 0.907
0.25
0.30
z = −1.322
Statistics 371
0.35
0.40
0.45
0.50
x = 0.34
Statistics 371
12
14
Probability Density
> gnorm(0.381, 0.031, a = 0.381 - 0.05, b = 0.381 + 0.05)
> gnorm(0.381, 0.031, a = 0.34, b = 0.4)
Find the proportion of eggs with shell thickness within 0.05 mm
of the mean.
Find the proportion of eggs with shell thickness between 0.34
and 0.4 mm.
area.
between two values.
Example Area Calculations: Central
Example Area Calculations: Area
mu = 0.381 , sigma = 0.031
mu = 0.381 , sigma = 0.031
Normal Distribution
Normal Distribution
P( 0.34 < X < 0.4 ) = 0.637
P( 0.331 < X < 0.431 ) = 0.8932
P( X < 0.34 ) = 0.093
P( X > 0.4 ) = 0.27
0.25
0.30
−3
−2
0.35
−1
0.40
0
1
0.45
2
Probability Density
0.50
P( X < 0.331 ) = 0.0534
P( X > 0.431 ) = 0.0534
0.25
0.30
3
−3
Statistics 371
17
−2
0.35
−1
0.40
0
1
0.45
2
0.50
3
Statistics 371
Example Area Calculations: Area to the
19
Example Area Calculations: Area
right
outside two values.
Find the proportion of eggs with shell thickness more than 0.4
mm.
Find the proportion of eggs with shell thickness smaller than 0.32
mm or greater than 0.40 mm.
> 1 - pnorm(q = 0.4, mean = 0.381, sd = 0.031)
[1] 0.2699702
> gnorm(0.381, 0.031, a = 0.32, b = 0.4)
> gnorm(0.381, 0.031, a = 0.4, sigma.axis = F)
Normal Distribution
Normal Distribution
mu = 0.381 , sigma = 0.031
mu = 0.381 , sigma = 0.031
Probability Density
P( 0.32 < X < 0.4 ) = 0.7055
Probability Density
P( X < 0.4 ) = 0.73
P( X > 0.4 ) = 0.27
0.25
0.35
0.45
Pr{Y > 0.4} = Pr{[Y − 0.381]/0.031 > [0.4 − 0.381]/0.031}
= Pr{Z > 0.613} = 1 − Pr{Z < 0.613} = 1 − 0.7291 = 0.2709
P( X < 0.32 ) = 0.0245
P( X > 0.4 ) = 0.27
0.25
0.30
−3
Statistics 371
0.35
−2
−1
0.40
0
0.45
1
2
0.50
3
Statistics 371
16
18
Probability Density
Quantile calculations ask you to use the normal table backwards.
You know the area but need to find the point or points on the
horizontal axis.
We have seen how to use R and the new function gnorm
to graph normal distributions where the graphs include some
probability calculations. You can also make the same calculations
Quantiles
Using R
without graphs using the function pnorm (the “p” stands for
probability). The following lists the commands for all of the
previous computations.
Area to the left. Find the proportion of eggs with shell
thickness less than 0.34 mm.
> pnorm(0.34, 0.381, 0.031)
[1] 0.09298744
Area to the right. Find the proportion of eggs with shell
thickness more than 0.36 mm.
> 1 - pnorm(0.36, 0.381, 0.031)
[1] 0.75093
Statistics 371
21
Example Area Calculations: Two-tail
Statistics 371
22
Using R
area.
> pnorm(0.36, 0.381, 0.031) - pnorm(0.34, 0.381, 0.031)
[1] 0.1560825
> gnorm(0.381, 0.031, a = 0.381 - 0.07, b = 0.381 + 0.07)
Area between two values. Find the proportion of eggs with
shell thickness between 0.34 and 0.36 mm.
Two-tail area. Find the proportion of eggs with shell thickness
more than 0.07 mm from the mean.
Area outside two values. Find the proportion of eggs with
shell thickness smaller than 0.32 mm or greater than 0.40 mm.
Normal Distribution
mu = 0.381 , sigma = 0.031
> pnorm(0.32, 0.381, 0.031) + 1 - pnorm(0.4, 0.381, 0.031)
[1] 0.2945190
P( 0.311 < X < 0.451 ) = 0.9761
Central area. Find the proportion of eggs with shell thickness
within 0.05 mm of the mean.
P( X < 0.311 ) = 0.012
P( X > 0.451 ) = 0.012
> 1 - 2 * pnorm(0.381 - 0.05, 0.381, 0.031)
[1] 0.8932345
0.25
0.30
−3
0.35
−2
−1
0.40
0
1
0.45
2
Two-tail area. Find the proportion of eggs with shell thickness
more than 0.07 mm from the mean.
0.50
> 2 * pnorm(0.381 - 0.07, 0.381, 0.031)
[1] 0.02394164
3
Statistics 371
20
Statistics 371
21
Probability Density
You can also make the same calculations without graphs using
the function qnorm (the “q” stands for quantile). The following
lists the commands for all of the previous computations.
Upper cut-off point. What value cuts off the top 15% of egg
shell thicknesses?
Using R
Example Quantile Calculations
> gnorm(0.381, 0.031, quantile = 0.85)
Normal Distribution
mu = 0.381 , sigma = 0.031
Percentile.
What is the 90th percentile of the egg shell
thickness distribution?
> qnorm(0.9, 0.381, 0.031)
[1] 0.4207281
Upper cut-off point. What value cuts off the top 15% of egg
shell thicknesses?
P( X < 0.4131 ) = 0.85
> qnorm(0.85, 0.381, 0.031)
[1] 0.4131294
z = 1.04
0.25
0.30
−3
−2
0.35
−1
0.40
0
1
0.45
2
0.50
Central cut-off points. The middle 75% egg shells have
thicknesses between which two values?
> qnorm(c(0.25/2, 1 - 0.25/2), 0.381, 0.031)
[1] 0.3453392 0.4166608
3
> gnorm(0.381, 0.031, quantile = 0.875)
> source("prob.R")
> gnorm(0.381, 0.031, quantile = 0.9)
Central cut-off points. The middle 75% egg shells have
thicknesses between which two values?
Percentile.
What is the 90th percentile of the egg shell
thickness distribution?
Example Quantile Calculations
Example Quantile Calculations
Statistics 371
Statistics 371
23
24
Normal Distribution
Normal Distribution
mu = 0.381 , sigma = 0.031
mu = 0.381 , sigma = 0.031
Probability Density
Probability Density
P( X < 0.4207 ) = 0.9
P( X < 0.4167 ) = 0.875
z = 1.15
z = 1.28
0.25
0.30
−3
0.35
−2
−1
0.40
0
0.45
1
2
0.25
0.50
0.30
−3
3
Statistics 371
23
0.35
−2
−1
0.40
0
0.45
1
2
0.50
3
Statistics 371
23
Binomial Distributions: increasing n
Binomial Distribution
n = 2 , p = 0.2
0.0
Binomial Distribution
n = 5 , p = 0.2
0.0
Probability
0.2
0.1
Probability
0.3
0.0 0.1 0.2 0.3 0.4 0.5 0.6
0.4
0.5
1.0
1.5
2.0
0
Binomial Distribution
n = 10 , p = 0.2
0.30
0.20
Probability
1
Possible Values
2
3
4
5
0
2
Possible Values
Binomial Distribution
n = 15 , p = 0.2
4
6
8
10
0
2
4
6
8
0
5
Possible Values
Example: binomial
> pbinom(55, 150, 0.4)
[1] 0.2274186
Possible Values
Binomial Distribution
n = 30 , p = 0.2
Normal approximation:
Binomial Distribution
n = 50 , p = 0.2
0.25
0.15
0.10
0.00
0.05
Probability
0.20
0.15
0.10
0.00
0.05
Probability
Assume Y has a binomial distribution with n = 150 and p = 0.4
and we want to compute Pr{Y ≤ 55}.
Exact:
0.10
0.00
0.12
0.08
10
15
0
5
Possible Values
10
15
20
Possible Values
Statistics 371
26
> mu = 150 * 0.4
> mu
[1] 60
> 150 * (1 - 0.4)
[1] 90
> sigma = sqrt(150 * 0.4 * 0.6)
> sigma
[1] 6
> pnorm(55, mu, sigma)
[1] 0.2023284
Statistics 371
Approximation of Discrete distributions
1
2
3
4
5
0
Poisson Distribution
mu = 2
2
Count
0
5
4
6
8
0
2
Poisson Distribution
mu = 5
4
Count
Poisson Distribution
mu = 10
• When approximating a binomial probability, the approximation is usually pretty good when np > 24 and n(1 − p) > 24.
• We will not be using the continuity correction described in
your book.
Statistics 371
28
Poisson Distributions: increasing n
using the Normal distribution
Poisson Distribution
mu = 1
• The normal distribution can also be used to compute
approximate probabilities of discrete distributions.
• Approximations to the binomial
distribution use a normal
q
curve with µ = np and σ = np(1 − p).
0
• Approximations to the Poisson distribution use a normal
√
curve with µ = µ and σ = µ.
10
15
20
6
8
0
5
10
Count
15
20
25
12
14
Poisson Distribution
mu = 25
30
0
10
20
Count
30
40
Count
Statistics 371
25
10
Count
Poisson Distribution
mu = 15
0.12
0.08
Probability
0.00
0.04
Probability
0.00 0.02 0.04 0.06 0.08 0.10
Probability
0.04
0.00
0.3
0.2
Probability
0.1
0.0
0.00
0.10
Probability
0.20
0.15
0.10
Probability
0.05
0.00
0.08
0.06
0.04
Probability
0.02
0.00
27
Example: Poisson
If Y has a Poisson distribution with µ = 25 what is the probability
that Y is greater than or equal to 16?
Exact:
> 1 - ppois(15, 25)
[1] 0.977707
Normal approximation:
> mu = 25
> sigma = sqrt(25)
> sigma
[1] 5
> 1 - pnorm(15, mu, sigma)
[1] 0.9772499
With R, do the exact calculation. With a calculator or normal
table, use the normal approximation.
Statistics 371
29
Download