Download Lect.4

Document related concepts

Statistics wikipedia , lookup

Probability wikipedia , lookup

History of statistics wikipedia , lookup

Transcript
Chapter 4
Lecture Slides
1
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 4:
Commonly Used Distributions
2
Introduction
• Statistical inference involves drawing a sample from a
population and analyzing the sample data to learn
about the population.
• We often have some knowledge about the probability
mass function or probability density function of the
population.
• In this chapter, we describe some of the standard
families of curves.
3
Section 4.1:
The Binomial Distribution
• We use the Bernoulli distribution when we have an
experiment which can result in one of two outcomes.
One outcome is labeled “success,” and the other
outcome is labeled “failure.”
• The probability of a success is denoted by p. The
probability of a failure is then 1 – p.
• Such a trial is called a Bernoulli trial with success
probability p.
4
Examples 1 and 2
1. The simplest Bernoulli trial is the toss of a coin.
The two outcomes are heads and tails. If we define
heads to be the success outcome, then p is the
probability that the coin comes up heads. For a fair
coin, p = 1/2.
2. Another Bernoulli trial is a selection of a
component from a population of components, some
of which are defective. If we define “success” to be
a defective component, then p is the proportion of
defective components in the population.
5
Binomial Distribution
If a total of n Bernoulli trials are conducted, and
 The trials are independent.
 Each trial has the same success probability p.
 X is the number of successes in the n trials.
then X has the binomial distribution with parameters n
and p, denoted X ~ Bin(n,p).
6
Example 3
A fair coin is tossed 10 times. Let X be the number of
heads that appear. What is the distribution of X?
7
Binomial R.V. Probability Mass Function
If X ~ Bin(n, p), the pmf of X is
n!

x
n x
p
(1

p
)
, x  0,1,..., n

p( x)  P( X  x)   x!(n  x)!
0, otherwise

8
Example 4
The probability that a newborn baby is a girl is
approximately 0.49. Find the probability that of the
next five single births in a certain hospital, no more than
two are girls.
9
Another Use of the Binomial
Assume that a finite population contains items of two
types, successes and failures, and that a simple random
sample is drawn from the population. Then if the
sample size is no more than 5% of the population, the
binomial distribution may be used to model the number
of successes.
10
Example 5
A lot contains several thousand components, 10% of
which are defective. Nine components are sampled
from the lot. Let X represent the number of defective
components in the sample. Find the probability that
exactly two are defective.
11
Tables for Binomial Probabilities
Table A.1 (in Appendix A) presents the binomial
probabilities of the form P(X ≤ x) for n ≤ 20 and
selected values of p.
12
Example 6
Of all the new vehicles of a certain model that are sold,
20% require repairs to be done under warranty during
the first year of service. A particular dealership sells 14
such vehicles. What is the probability that fewer than
five of them require warranty repairs?
13
Binomial R.V. Mean and Variance
 Mean: X = np
 Variance:  X2  np(1  p)
14
Section 4.2:
The Poisson Distribution
 One way to think of the Poisson distribution is as an
approximation to the binomial distribution when n is
large and p is small.
 It is the case when n is large and p is small that the
mass function depends almost entirely on the mean
np, and very little on the specific values of n and p.
 We can therefore approximate the binomial mass
function with a quantity λ = np; this λ is the
parameter in the Poisson distribution.
15
Poisson R.V.:
pmf, mean, and variance
If X ~ Poisson(λ), the probability mass function of X is
 e   x
, for x = 0, 1, 2, ...

p ( x)  P( X  x)   x !
0, otherwise
 Mean: X = λ
 Variance:  X2  
Note: X must be a discrete random variable and λ must
be a positive constant.
16
Probability Histogram
17
The Poisson and Binomial Distributions
X~Bin(10000, 0.0002) find P(X=3)
10,000!
3
9997
P( X  3)  !
(
0
.
0002
)
(
1

0
.
0002
)
 0.18047
!
3 9997
Using Poisson approximation
 = np = 10000*0.0002=2
3
2
P( X  3)  e 2 !  0.18045
3
18
Example 7
Particles (e.g., yeast cells) are suspended in a liquid
medium at a concentration of 6 particles per mL. A
large volume of the suspension is thoroughly agitated,
and then 1 mL is withdrawn. What is the probability
that exactly 4 particles are withdrawn?
19
Example 7a
Particles are suspended in a liquid medium at a
concentration of 6 particles per mL. A large volume of
the suspension is thoroughly agitated, and then 3 mL are
withdrawn. What is the probability that exactly 15
particles are withdrawn?
20
Example 7c
The number of email messages received by a computer
server follows a Poisson distribution with a mean of 6
per minute. Find the probability that exactly 20
messages will be received in the next 3 minutes.
21
Section 4.3:
The Normal Distribution
The normal distribution (also called the Gaussian
distribution) is by far the most commonly used
distribution in statistics. This distribution provides a
good model for many, although not all, continuous
populations.
The normal distribution is continuous rather than
discrete. The mean of a normal population may have
any value, and the variance may have any positive
value.
22
Normal R.V.:
pdf, mean, and variance
The probability density function of a normal population
with mean  and variance 2 is given by
1
f ( x) 
e  ( x   ) / 2 ,    x  
 2
2
2
If X ~ N(, 2), then the mean and variance of X are
given by
X  
 X2   2
23
68-95-99.7% Rule
This figure represents a plot of the normal probability density
function with mean  and standard deviation . Note that the
curve is symmetric about , so that  is the median as well as the
mean. It is also the case for the normal population.
 About 68% of the population is in the interval   .
 About 95% of the population is in the interval   2.
 About 99.7% of the population is in the interval   3.
24
Standard Units
• The proportion of a normal population that is within a
given number of standard deviations of the mean is the
same for any normal population.
• For this reason, when dealing with normal
populations, we often convert from the units in which
the population items were originally measured to
standard units.
• Standard units tell how many standard deviations an
observation is from the population mean.
25
Standard Normal Distribution
In general, we convert to standard units by subtracting
the mean and dividing by the standard deviation. Thus,
if x is an item sampled from a normal population with
mean  and variance 2, the standard unit equivalent of
x is the number z, where
z = (x - )/.
The number z is sometimes called the “z-score” of x.
The z-score is an item sampled from a normal
population with mean 0 and standard deviation of 1.
This normal distribution is called the standard normal
distribution.
26
Example 8
Resistances in a population of wires are normally
distributed with mean 20 mΩ and standard deviation 3
mΩ. The resistance of two randomly chosen wires are
23 mΩ and 16 mΩ. Convert these amounts to standard
units.
27
Example 8 cont.
The resistance of a wire has a z-score of –1.7. Find
resistance of the wire in the original units of mΩ.
28
Finding Areas Under the Normal Curve
• The proportion of a normal population that lies within a given
interval is equal to the area under the normal probability density
above that interval. This would suggest integrating the normal
pdf, but this integral does not have a closed form solution.
• So, the areas under the curve are approximated numerically and
are available in Table A.2. This table provides area under the
curve for the standard normal density. We can convert any
normal into a standard normal so that we can compute areas
under the curve.
• The table gives the area in the left-hand tail of the curve. Other
areas can be calculated by subtraction or by using the fact that
the total area under the curve is 1.
29
Example 9
Find the area under normal curve to the left of z = 0.47.
Find the area under the curve to the right of z = 1.38.
30
Example 10
Find the area under the normal curve between z = 0.71
and z = 1.28.
What z-score corresponds to the 75th percentile of a
normal curve?
31
Linear Functions of Normal Random
Variables
32
Example 11
A chemist measures the temperature of a solution in oC.
The measurement is denoted C, and is normally
distributed with mean 40 oC and standard deviation 1oC.
The measurement is converted to oF by the equation
F = 1.8C + 32. What is the distribution of F?
33
Distributions of Functions of Normal
Random Variables
Let X1, X2, …, Xn be independent and normally distributed with
mean  and variance 2. Then
 σ2 
X ~ N  μ,  .
 n 
Let X and Y be independent, with X ~ N(X,
2
Y ~ N(Y, σY ). Then
σ X2 ) and
X  Y ~ N ( μ X  μY , σ  σ )
2
X
2
Y
X  Y ~ N ( μ X  μY , σ  σ )
2
X
2
Y
34
Section 4.4:
The Lognormal Distribution
• For data that contain outliers, the normal distribution
is generally not appropriate. The lognormal
distribution, which is related to the normal
distribution, is often a good choice for these data sets.
• If X ~ N(,2), then the random variable Y = eX has
the lognormal distribution with parameters  and 2.
• If Y has the lognormal distribution with parameters 
and 2, then the random variable X = lnY has the
N(,2) distribution.
35
Lognormal pdf, mean, and variance
 The pdf of a lognormal random variable with parameters  and
2 is
 1
 1
2
exp

(ln
x


)
,x  0

2


f ( x)   x 2
 2

0, otherwise

 Mean: E(Y )  e
  2 / 2
 Variance: V (Y )  e
2   2 2
e
2   2
36
Example 12
When a pesticide comes into contact with the skin, a
certain percentage of it is absorbed. The percentage that
is absorbed during a given time period is often modeled
with a lognormal distribution. Assume that for a given
pesticide, the amount that is absorbed (in percent)
within two hours is lognormally distributed with a mean
of 1.5 and standard deviation of 0.5. Find the
probability that more than 5% of the pesticide is
absorbed within two hours.
37
Section 4.5:
The Exponential Distribution
• The exponential distribution is a continuous
distribution that is sometimes used to model the time
that elapses before an event occurs. Such a time is
often called a waiting time.
• The probability density of the exponential distribution
involves a parameter, which is a positive constant λ
whose value determines the density function’s
location and shape.
• We write X ~ Exp(λ).
38
Exponential R.V.:
pdf, cdf, mean and variance
The pdf of an exponential r.v. is
 e   x , x  0
f ( x)  
.
0, otherwise
The cdf of an exponential r.v. is
0, x  0
F ( x)  
.
x
1  e , x  0
The mean of an exponential r.v. is
μx = 1/λ
The variance of an exponential r.v. is
σx2 = 1/λ2.
39
Example 13
A radioactive mass emits particles according to a
Poisson process at a mean rate of 15 particles per
minute. At some point, a clock is started.
1. What is the probability that more than 5 seconds will
elapse before the next emission?
2. What is the mean waiting time until the next particle
is emitted?
40
Lack of Memory Property
The exponential distribution has a property known as
the lack of memory property: If T ~ Exp(λ), and t and s
are positive numbers, then
P(T > t + s | T > s) = P(T > t).
41
Example 14
The lifetime of a transistor in a particular circuit has an
exponential distribution with mean 1.25 years.
1. Find the probability that the circuit lasts longer than
2 years.
2. Assume the transistor is now three years old and is
still functioning. Find the probability that it
functions for more than two additional years.
3. Compare the probability computed in 1. and 2.
42
Section 4.6: Some Other Continuous
Distributions
The uniform distribution has two parameters, a and b,
with a < b. If X is a random variable with the
continuous uniform distribution then it is uniformly
distributed on the interval (a, b). We write X ~ U(a,b).
The pdf is
 1
, a xb

f ( x)   b  a
0, otherwise
43
Mean and Variance
If X ~ U(a, b).
Then the mean is
ab
μX 
2
and the variance is
(b  a )
σ 
.
12
2
2
X
44
The Gamma Distribution
First, let’s consider the gamma function:
For r > 0, the gamma function is defined by
 r 1  t
(r )  0 t e dt .
The gamma function has the following properties:
1. If r is any integer, then Γ(r) = (r – 1)!.
2. For any r, Γ(r + 1) = r Γ(r).
3. Γ(1/2) =  .
45
Gamma R.V.
• If X~(r, ) has a gamma distribution with parameters
r > 0 and λ > 0, then the pdf is
x e
,x  0

f ( x)   ( r )
.
0, x  0

r 1   x
• If X~(r, ) then the mean and variance are given by
 X  r /  and  X2  r /  2 , respectively.
• If r = 1, the gamma distribution is the same as the
exponential.
• If r = k/2, where k is a positive integer, the (r, 1/2)
distribution is called a chi-square distribution with k
degrees of freedom.
46
Gamma R.V.
X~(r, )
  x r 1e  x
,x  0

f ( x)   ( r )
.
0, x  0

47
The Weibull Distribution
The Weibull distribution is a continuous random
variable that is used in a variety of situations. A
common application of the Weibull distribution is to
model the lifetimes of components. The Weibull
probability density function has two parameters, both
positive constants, that determine the location and
shape. We denote these parameters  and .
If  = 1, the Weibull distribution is the same as the
exponential distribution with parameter λ = .
48
Weibull R.V.
The pdf of the Weibull distribution is
  x 1e (  x ) , x  0
f ( x)  
.
0, x  0
The mean of the Weibull is
1 
1
 X   1   .
  
The variance of the Weibull is

2

1  
2    1  

2
 X  2  1     1    .
          
49
Example 15
Weibull distribution to model the duration of a bake
step in the manufacture of a semiconductor. Let T
represent the duration in hours of the bake step for a
randomly chosen lot. If T~Weibull(0.3, 0.1), what is the
probability that the bake step takes longer than four
hours? What is the probability that it takes between two
and seven hours?
50
Section 4.7: Probability Plots
• Scientists and engineers often work with data that can
be thought of as a random sample from some
population. In many cases, it is important to
determine the probability distribution that
approximately describes the population.
• More often than not, the only way to determine an
appropriate distribution is to examine the sample to
find a sample distribution that fits.
51
Finding a Distribution
Probability plots are a good way to determine an
appropriate distribution.
Here is the idea: Suppose we have a random sample
X1,…,Xn. We first arrange the data in ascending order.
Then assign evenly spaced values between 0 and 1 to
each Xi. There are several acceptable ways to this; the
simplest is to assign the value (i – 0.5)/n to Xi.
The distribution that we are comparing the X’s to should
have a mean and variance that match the sample mean
and variance. Next we calculate the quantile (Qi)
corresponding to that number from the distribution of
interest. Then we plots each (Xi, Qi). If this plot is a
reasonably straight line then we may conclude that the
sample came from the distribution that we used to find 52
quantiles.
Normal Probability Plots
The sample plotted on the left comes from a population
that is not close to normal. The sample plotted on the
right comes from a population that is close to normal.
Section 4.8: The Central Limit Theorem
 2 

X ~ N   ,
n 

S n ~ N (n , n 2 )
54
Rule of Thumb
For most populations, if the sample size is greater than 30, the
Central Limit Theorem approximation is good.
Normal approximation to the Binomial:
If X ~ Bin(n,p) and if np > 5, and n(1– p) > 5, then
X ~ N(np, np(1-p)) approximately.
Normal Approximation to the Poisson:
If X ~ Poisson(λ), where λ > 10, then X ~ N(λ, λ).
55
Continuity Correction
• The binomial distribution is discrete, while the normal
distribution is continuous.
• The continuity correction is an adjustment, made when
approximating a discrete distribution with a
continuous one, that can improve the accuracy of the
approximation.
• If you want to include the endpoints in your
probability calculation, then extend each endpoint by
0.5. Then proceed with the calculation.
• If you want exclude the endpoints in your probability
calculation, then include 0.5 less from each endpoint
in the calculation.
56
Continuity Correction
57
Example 15
If a fair coin is tossed 100 times, use the normal curve
to approximate the probability that the number of heads
is between 45 and 55 inclusive.
58
59
Example 16
The number of hits on a website follow a Poisson
distribution, with a mean of 27 hits per hour. Find the
probability that there will be 90 or more hits in three
hours.
60
Summary
• Discrete Distributions
– Bernoulli
– Binomial
– Poisson.
• Continuous distributions
– Normal
– Exponential
– Uniform
– Gamma
– Weibull.
• Central Limit Theorem.
• Normal approximations to the Binomial and Poisson
distributions
61