5.2 Continuous Random Variable

44
5.2 Continuous Random Variable

description

5.2 Continuous Random Variable. Recall Discrete Distribution. For a discrete distribution, for example Binomial distribution with n=5, and p=0.4, the probability distribution is x 0 1 2 3 4 5 - PowerPoint PPT Presentation

Transcript of 5.2 Continuous Random Variable

Page 1: 5.2 Continuous Random Variable

5.2 Continuous Random Variable

Page 2: 5.2 Continuous Random Variable

Recall Discrete Distribution

• For a discrete distribution, for example Binomial distribution with n=5, and p=0.4, the probability distribution is

x 0 1 2 3 4 5f(x) 0.07776 0.2592 0.3456 0.2304 0.0768 0.01024

Page 3: 5.2 Continuous Random Variable

A probability histogram

x0 1 2 3 4 5

0.0

0.1

0.2

0.3

P(x)

Page 4: 5.2 Continuous Random Variable

How to describe the distribution of a continuous random variable?

• For continuous random variable, we also represent probabilities by areas—not by areas of rectangles, but by areas under continuous curves.

• For continuous random variables, the place of histograms will be taken by continuous curves.

• Imagine a histogram with narrower and narrower classes. Then we can get a curve by joining the top of the rectangles. This continuous curve is called a probability density (or probability distribution).

Page 5: 5.2 Continuous Random Variable

Continuous distributions: Density Function

• For any x, P(X=x)=0. (For a continuous distribution, the area under a point is 0.)

• Can’t use P(X=x) to describe the probability distribution of X

• Instead, consider P(a≤X≤b)

Page 6: 5.2 Continuous Random Variable

Density Function

• A probability density function for a continuous random variable X is a nonnegative function f(x) with

• And such that for all a≤b, one is willing to assign P[a≤X≤b] according to

( ) 1f x dx

[ ] ( )b

aP a X b f x dx

Page 7: 5.2 Continuous Random Variable

Density function

• A curve f(x): f(x) ≥ 0 • The area under the

curve is 1

• P(a≤X≤b) is the area between a and b

0 2 4 6 8 10

x

0.00

0.05

0.10

0.15

0.20

0.25

y

Page 8: 5.2 Continuous Random Variable

P(2≤X≤4)= P(2≤X<4)= P(2<X<4)

0 2 4 6 8 10

x

0.00

0.05

0.10

0.15

0.20

0.25

y

Page 9: 5.2 Continuous Random Variable
Page 10: 5.2 Continuous Random Variable
Page 11: 5.2 Continuous Random Variable

Cumulative Probability function

• For X continuous with probability density f(x)

• We can get the density function f(x) from F(x) by differentiation

( ) [ ] ( )x

F x P X x f t dt

( ) ( )d F x f xdx

Page 12: 5.2 Continuous Random Variable

0

( ) , 0

( ) 1

conversely

( ) (1 )

x

x t x

x x

f x e x

F x e dt e

df x e edx

Page 13: 5.2 Continuous Random Variable
Page 14: 5.2 Continuous Random Variable
Page 15: 5.2 Continuous Random Variable
Page 16: 5.2 Continuous Random Variable

The normal distribution• A normal curve: Bell shaped• Density is given by

• μand σ2 are two parameters: mean and variance of a normal population

(σ is the standard deviation)

2

2

1 ( )( ) exp22

xf x

Page 17: 5.2 Continuous Random Variable

The normal—Bell shaped curve: μ=100, σ2=10

90 95 100 105 110

x

0.00

0.02

0.04

0.06

0.08

0.10

0.12

fx

Page 18: 5.2 Continuous Random Variable

Normal curves:(μ=0, σ2=1) and (μ=5, σ 2=1)

-2 0 2 4 6 8

x

0.0

0.1

0.2

0.3

0.4

fx1

Page 19: 5.2 Continuous Random Variable

Normal curves:(μ=0, σ2=1) and (μ=0, σ2=2)

-3 -2 -1 0 1 2 3

x

0.0

0.1

0.2

0.3

0.4

y

Page 20: 5.2 Continuous Random Variable

Normal curves:(μ=0, σ2=1) and (μ=2, σ2=0.25)

-2 0 2 4 6 8

x

0.0

0.2

0.4

0.6

0.8

1.0

fx1

Page 21: 5.2 Continuous Random Variable

The standard normal curve: μ=0, and σ2=1

-3 -2 -1 0 1 2 3

x

0.0

0.1

0.2

0.3

0.4

y

Page 22: 5.2 Continuous Random Variable

Table B.3 gives probabilities for standard normal (Numerical Integration – No

formula for

From Table B.3 = 0.9332

Page 23: 5.2 Continuous Random Variable

If , then

Page 24: 5.2 Continuous Random Variable

Example:

Page 25: 5.2 Continuous Random Variable

Example (p323 #7)

• In a grinding operation, there is an upper specification of 3.15 in. on a dimension of a certain part after grinding. Suppose that the standard deviation of this normally distributed dimension for parts of this type ground to any particular mean dimension μ is σ=.002 in. Suppose further that you desire to have no more than 3% of the parts fail to meet specifications. What is the maximum μ (minimum machining cost) that can be used if this 3% requirement is to be met?

Page 26: 5.2 Continuous Random Variable

3.140 3.142 3.144 3.146 3.148 3.150 3.152

050

100

150

200

x

y

3.142 3.144 3.146 3.148 3.150 3.152 3.154

050

100

150

200

x2

y2

Page 27: 5.2 Continuous Random Variable

3.140 3.142 3.144 3.146 3.148 3.150 3.152

050

100

150

200

x

y

-3 -2 -1 0 1 2 3

0.0

0.1

0.2

0.3

0.4

z

fz

( 3.15) 0.03P X

( _____) 0.03P Z

( 1.88) 0.03P Z

So 3.15 is 1.88 σ above the mean.3.15-1.88*0.002=3.146

Page 28: 5.2 Continuous Random Variable
Page 29: 5.2 Continuous Random Variable

Exponential distribution

• The exponential distribution is a continuous probability distribution with

• Exponential distributions are often used to describe waiting times until occurrence of events.

/1( ) , 0xf x e x

Page 30: 5.2 Continuous Random Variable

Density curves

0 1 2 3 4 5

0.0

0.2

0.4

0.6

0.8

1.0

alpha=1x

y

0 1 2 3 4 5

0.0

0.2

0.4

0.6

0.8

1.0

alpha=2x

dexp

(x, 0

.5)

( ) , 0xf x e x / 21( ) , 0

2xf x e x

Page 31: 5.2 Continuous Random Variable

Mean and Variance• Mean of an exponential distribution is

• Variance of the exponential distribution is

/

0

1( ) xE X x e dx

2 2 / 2

0

1( ) ( ) xVar X x e dx

Page 32: 5.2 Continuous Random Variable

Cumulative Probability Function/( ) 1 xF x e

0 1 2 3 4 5

0.0

0.2

0.4

0.6

0.8

1.0

alpha=1x

pexp

(x, 1

)

0 1 2 3 4 5

0.0

0.2

0.4

0.6

0.8

1.0

alpha=2x

pexp

(x, 0

.5)

Page 33: 5.2 Continuous Random Variable

P(X<2) on density curve f(x) P(X<2) on CDF F(x)

0 1 2 3 4 5

0.0

0.2

0.4

0.6

0.8

1.0

alpha=1x

pexp

(x, 1

)

0 1 2 3 4 5

0.0

0.2

0.4

0.6

0.8

1.0

x

y

2( 2) (2) 1 0.8647P X F e When alpha=1

Page 34: 5.2 Continuous Random Variable

Relationship between Exponential Distribution and Poisson

Ships arrive 2/ hour. The number of ships arriving in 1 hour is a Poisson

random variable with λ=2

Let’s define a new random variable X to be the waiting time until the first ship.

P(X≥x)=P(0 ships by time x) F(x)=P(X≤x) =1-P(0 ships by time x)

Page 35: 5.2 Continuous Random Variable

An exponential distribution with mean has

/1( ) xf x e

As above with

Memoryless property: If we have already waited H hours and haven’t seen a ship, our expected waiting time is . Our expected waiting time is like starting all

over again. The probability of a ship showing up in the next 5 minutes is the same as when we started.

Page 36: 5.2 Continuous Random Variable
Page 37: 5.2 Continuous Random Variable

Force of Mortality Function

• The force of Mortality Function is (p.760):

• H(t)dt is the probability of dying in time t to t+dt if we are still living in t.

• For exponential distribution

• So the exponential distribution has a constant force-of-mortality.

/

/

1( ) ( ) 1( )

( ) 1 ( ) 1 (1 )

x

x

ef t f th tP T t F t e

( ) ( )( )( ) 1 ( )f t f th t

P T t F t

Page 38: 5.2 Continuous Random Variable

• If the lifetime of an engineering component is described using a constant force of mortality, there is no (mathematical) reason to replace such a component before it fails.

• The distribution of its remaining life from any point in time is the same as the distribution of the time till failure of a new component of the same type.

Page 39: 5.2 Continuous Random Variable

The geometric distribution is also memoryless. X = time to success. The expected tosses to next head doesn’t depend on how long we have been tossing without getting a head.

Lifetimes of glasses in a restaurant might be exponential. Motor lifetimes or people’s lifetimes are not. Sometimes lifetimes can be modeled with a lognormal distribution where

Page 40: 5.2 Continuous Random Variable

Section 5.2.3 Weibull Distribution

Very commonly lifetimes of motors, etc. are modeled with Weibull distributions. A Weibull distribution is a generalization of an exponential distribution and provides more flexibility in terms of distributional shape.

Page 41: 5.2 Continuous Random Variable

For Weibull distribution

( / )( ) 1 xF x e

1 ( / )( ) ( ) xdf x F x x edx

1( ) (1 )E X

Page 42: 5.2 Continuous Random Variable

Gamma function

For the force-of-mortality is a decreasing function, for example, a product break in a period.

Constant force-of-mortality. Exponential distribution Increasing force-of-mortality, for example, a product that wears out.

Page 43: 5.2 Continuous Random Variable

• For component with increasing force-of-mortality (IFM) distribution, such components are retired from service once they reach a particular age, even if they have not failed.

Page 44: 5.2 Continuous Random Variable

Exercise

The lifetime of a certain type of battery has an exponential distribution with average lifetime 100 hours. 5 batteries are installed at the same time and suppose that the operations of the batteries are independent. Find the probability that only 2 batteries are still working after 50 hours.