29
1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

Embed Size (px)

Citation preview

Page 1: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1

Topic 4 - Continuous distributions

• Basics of continuous distributions • Uniform distribution • Normal distribution • Gamma distribution

Page 2: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2

Continuous Random Variables• A continuous random variable can take on values

from an entire interval of the real line.

• The probability density function (pdf) of a continuous random variable, X, is a function f(x) such that for a < b

• The cumulative density function (cdf) of X is defined as

( ) ( )b

a

P a X b f x dx

( ) ( ) ( )x

F x P X x f t dt

2

Page 3: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

33

Some relationships

• What is the relationship between the pdf (f) and the cdf (F)?

– You integrate the pdf to get the cdf– You take the derivative of the cdf to get the

pdf

• P(a ≤ X ≤ b) = F(b) – F(a)

• P(X = a) = P(a ≤ X ≤ a) = F(a) – F(a) = 0

'( ) ( )f x F x

Page 4: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

44

Pipeline example• A pipeline is 100 miles long and every location along the

pipeline is equally likely to break

• Let X be the distance measured in miles from the pipeline origin where a break occurs

• What is the cdf for X?

• What is the pdf for X?

• What is P(30 ≤ X ≤ 50)?

( ) , for 0 100100

xP X x x

' 1( ) ( ) , for 0 x 100, 0 otherwise

100f x F x

Page 5: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

55

Requirements of a pdf

• A pdf must satisfy the following two requirements:

• Does the pipeline pdf satisfy these requirements?

( ) 0 for all or ranges of

( ) 1

f x x x

f x dx

10 100

( ) 1000

xf x

otherwise

1001000

0

1

100 100

xdx

Page 6: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

66

Mean and variance of a cont. random variable

lim

lim

2 2

lim2 2 2 2 2

lim

lim

lim

( ), * ( ) , the mean of or exp. value of

[( ) ], variance of

( ) , where ( ) * ( )

( ( )) ( )* ( ) , expected value of ( )

X

X X

X X

E X x f x dx X X

E X X

E X E X x f x dx

E h X h x f x dx h X

Page 7: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

Comparisons discrete to continous

7

Page 8: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

88

Uniform distribution

• A uniform distribution on the interval from A to B, U(A,B), is defined by a pdf of the form

• Does f(x) meet requirements?

• What is the cdf for the Uniform distribution?

1( ) for f x A x B

B A

1all ( ) 0 and 1

-

B

A

B Af x dx

B A B A

0

for 1

( ) for

for 1

x

A

x Ax A

F X dx A x BB A B A

x B

Page 9: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

99

Uniform, etc.

• What is the mean of the Uniform distribution?

• What is the variance of the Uniform distribution?– Using the same methodology as outlined above….

1B

x

A

x dxB A

2

B A

2( )E X 2 2

3

B AB A

2x 2( )

12

B A

Page 10: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1010

Gamma distribution• The gamma distribution, is defined by the

following pdf

where

• This is more for background purposes. We will not be doing Gamma calculations by hand.

• Properties of the gamma function, – For – If is a positive integer, –

1 /1( ) , 0, 0, 0

( )xf x x e x

1

0

( ) for 0.xx e dx

Page 11: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1111

Properties of the Gamma distribution• The Gamma is a valid pdf. All probabilities are at least 0

and the integral across all values of X (summation) is 1.

• Example w/o calculus is not possible, but

• “Proofs” information of the above concept are contained briefly in the Moment Generating Functions section of Topic 3 Files.

2 2 and ( )u

Page 12: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1212

More on the gamma distribution• The gamma distribution is used as a probability model for the

time or space before the th event in a Poisson process where events occur at the rate Number of events is fixed and the interval is varied. Opposite of the Poisson.

is called the shape parameter

– Normally listed as a specific number of events in the problem.

is called the scale parameter, where is defined by the Poisson.

• The exponential distribution is a special case of the gamma This with This distribution is used to model the time “between” events that are Poisson distributed (the “next” occurrence).

Page 13: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1313

Uses of the Gamma Distribution

• Some examples of use for the Gamma include:

– Queuing models, the flow of items through manufacturing and distribution processes and the load on web servers and the varied forms of telecommunications systems.

• These are based on a series of exponentially distributed values, which is a simplified Gamma distribution (mean time between arrivals).

– Due to its moderately skewed profile, it can be used as a model in a  range of disciplines.

• Climatology, where it is a workable model for rainfall• Financial services where it has been used for modelling

insurance claims and the size of loan defaults and as such has been used in probability of ruin and value at risk calculations.

Page 14: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1414

Back to the clunker car

• Recall that my car breaks down once a week on average. If the breakdowns occur as events in a Poisson process, then what is the probability less than a week passes before my first breakdown? Gamma or Poisson?

Which calculator

Page 15: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1515

Pipe example

• Defects along a piece of pipe occur as events in a Poisson process with an average of 2 defects every 10 feet. What is the probability that the third defect will occur at least 20 feet from the beginning of the pipe?

– How do you define the distribution?

– How do you write the probability statement in this case?

Which calculator

What is , and ?

Page 16: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1616

Check out counter example

• Customers arriving at a checkout counter of a supermarket are Poisson distributed at a rate of one every two minutes. What is the probability that at most 10 minutes pass before a 3rd customer arrives in the line?

– What’s lambda?• Occurrences over time…..1 per 2 minutes or 5 per 10 minutes,

so lambda is 5/10

– What’s alpha?• Shape parameter…..in this case, the probability associated with

the 3rd customer.– What’s beta?

• Scale parameter….always 1 divided by lambda, so in this case, it’d be 2.

Which calculator

Page 17: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

1717

Normal distribution• The normal distribution, N(2), has a pdf given by

• The normal distribution is always bell shaped.

• The normal distribution is defined in terms of its mean and standard deviation, since those parameters are on a consistent basis and are comparable.

• Again, we will not be doing hand calculations of probabilities using this function, but you could approximate it by taking the integral within the stated limits.

2

2

( )

21( ) -

2

x

f x e x

Page 18: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

18

Empirical rule

• This is a rough approximation or “back of the envelope” guide to the areas under the Normal.

• What is the “approximate” or “rough” probability …..

– a normal falls within one standard deviation of the mean?

– a normal falls within two standard deviations of the mean?

– a normal falls within three standard deviations of the mean?

18

Page 19: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

19

Empirical rule (cont)

• What is the “approximate” or “rough” probability for a normal distribution that a randomly selected value -– Falls +/- 1 standard deviation of the mean?– Falls +/- 2 standard deviation of the mean? – Falls +/- 3 standard deviation of the mean?

19

Page 20: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2020

Side effects of anti-depressant meds • The weight gain associated with an antidepressant is

normally distributed with a mean of 6 lbs and a standard deviation of 3 lbs. Using the Empirical Rule ----

• What is the approximate probability of weight loss?• What is the approximate probability of a weight gain

between 0 and 12 pounds?• What is the approximate probability of a weight gain

between 9 and 12 pounds?

Page 21: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2121

Weight gain example – more exact

• The weight gain associated with an antidepressant is normally distributed with a mean of 6 lbs and a standard deviation of 3 lbs.

• What is the probability of weight gain?

• What is the probability of gaining between 0 and 12 lbs?

Normal calculator

Page 22: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2222

Cement Production Example

• ImanAggie Redimix has a contract with TxDot to supply concrete for one of the overpasses on Hwy 6 just south of town.

• Assume that company’s production is normally distributed with a mean of 3,200 psi and a standard deviation of 250 psi, what’s the probability that a specific batch will have a strength below 2,700 psi?

• Why is that important?

• Demonstrate on the next slide.

Page 23: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2323

Cement Production Example (cont)• The distribution of production values looks like this..

Normal calculator

Page 24: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2424

Standard normal distribution

• If X has a N(2) distribution, then Z=(X-)/ has a standard normal distribution, N(0,1).

• The standard normal is an important reference distribution.

• P(X ≤ x) = P(Z ≤ (x-)/) = (x-)/

• The cdf of a standard normal, z), is tabled in many textbooks.

• Standardized values, (x-)/indicate how far in standard deviations the value x is from

• For any normal distribution, probabilities can be phrased in terms of standardized values

Page 25: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2525

Examples of converting x to Z and from Z to x

• It’s important to be able to make this conversion. The cement foreman doesn’t know a Z from a hole in the ground, but he knows his production (which is all x values)

• Given X~N(3200,250), what’s P(X<2700)?

• Remember that Phi of -2, , is the area to the left of 2 standard deviations to the left of the mean on the Normal.

( ) /

(2700 3200) / 62500 2

( 2) .0228

Z x

Z

( 2) .0228

Page 26: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2626

….and conversely

• Suppose that ImanAggie wants to make the marketing claim that less than 1% of their product fall below a certain psi level. How do you determine that level of psi?

• What’s the value of psi, such that 5% of the overall production is below that level?

• This type of calculation shows up a lot in Statistics.

( ) .01 Z~-2.326

( ) / 2.326 ( 3200) / 250

solve for x........ 2618.5

Z

Z x x

x

( ) .05 Z~-1.645

( ) / 1.645 ( 3200) / 250

solve for x........ 2788.75

Z

Z x x

x

Page 27: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2727

Comparison of X and Z values

Page 28: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2828

Is my data normal?

• In StatCrunch, a quantile-quantile plot (QQ plot) plots ordered data values versus quantiles of a standard normal distribution.

• If the data are from a normal distribution, the points should lie approximately on a straight line.

• BIG problems associated with assuming you have a normal, when the data’s not really normal.

QQ Plot Example

Page 29: 1 Topic 4 - Continuous distributions Basics of continuous distributions Uniform distribution Normal distribution Gamma distribution

2929

Other distributions

• The Weibull distribution and the log normal distribution are used to model mean time to failure. Therefore, used a lot in reliability studies.

• The beta distribution is used to model proportions.

• There are many other distributions out there. Choose the one that serves as the best probability model for your setting.

• Waaay out of scope for STAT 211…

The additional file for Topic 4 has worked out examples (some with discussion) for a variety of continuous distribution applications.