5.2 Continuous Random Variable
description
Transcript of 5.2 Continuous Random Variable
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
A probability histogram
x0 1 2 3 4 5
0.0
0.1
0.2
0.3
P(x)
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).
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)
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
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
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
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
0
( ) , 0
( ) 1
conversely
( ) (1 )
x
x t x
x x
f x e x
F x e dt e
df x e edx
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
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
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
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
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
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
Table B.3 gives probabilities for standard normal (Numerical Integration – No
formula for
From Table B.3 = 0.9332
If , then
Example:
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?
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
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
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
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
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
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)
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
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)
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.
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
• 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.
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
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.
For Weibull distribution
( / )( ) 1 xF x e
1 ( / )( ) ( ) xdf x F x x edx
1( ) (1 )E X
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.
• 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.
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.