1
Continuous Distributions
1 Random Variables of theContinuous Type
2
Density Curve
Percent
A smooth curve that fit the distribution 10 20 30 40 50 60 70 80 90 100 110 Test scores Density function, f (x) f(x) 3
Density Curve
A smooth curve that fit the distribution
Percent
Use a mathematical model to describe the variable.
10 20 30 40 50 60 70 80 90 100 110
Test scores
Shows the probability density for all values of x.
Probability density is not probability! Probability Density Function, f (x) f(x) 4
Continuous Distribution
1. f (x) 0, xS,2.S f(x) dx = 1, (Total area under curve is 1.)
3. For a and b in S,
Probability Density Function (p.d.f.)of a random variable X of continuous type with a space S is an integrable function, f(x), that satisfying the following conditions:
b a f xdx b X a P( ) ( ) f(x) x a b 5Meaning of Area Under Curve
Example: What percentage of the
distribution is in between 72 and 86?
f(x)
X (Height) 72 86
P(X = 72) =
P(72 X 86)
0, density is not probability. 6
Meaning of Area Under Curve
Example: What percentage of the
distribution is in between 72 and 86?
f(x)
X (Height) 72 86
P(72 X 86) =P(72 < X < 86) =P(72 X <86) =P(72 < X 86)
7 4 / 1 0 2 2 8x 1/4 0 2 4x elsewhere , 0 0.5 0 for , 8 ) (x x x f 0.5 f (x) = 8x is a line with a slope 8 and passes through (0,0)
0 x
f (x) = y
Example:
If the density function of a continuous distribution is
Find the proportion of values in this distribution that is less than 1/4.
= 4(1/4)2 – 4(0)2 = 4/16 = 1/4.
1/4 0 8 xdx The area under the f (x) between 0 and 1/4 =8
Review of Calculus
c x n dx xn n
1 1 1 c e a adx du ax u du a e dx e u u ax
1 , 1
e2xdx e2xc 2 1
c x c x dx x3 31 4 4 1 1 3 1 9 b x b e 3 5 / ) ( lim 0 for , 5 1 ) (x e5 x f x Example:If the density function of a continuous distribution X, waiting time between arrivals of cars at a intersection, is
3 5 5 1 e dx x-The area under the f (x) and x > 3 =
5488 . 0 ) 5488 . 0 ( 0 ) ( ) ( lim /5 3/5 e e b b
Find the probability that the waiting time (in seconds) till the next arrival of car at this intersection is more than 3 seconds.
3 0 x f (x) = y .2 10 3 0 5 / ) (ex 0 for , 5 1 ) (x e5 x f x Example:
If the density function of a continuous distribution X, waiting time between arrivals of cars at a intersection, is
3 0 5 5 1 e dx x-The area under the f (x) below 3 =
4522 . 0 5488 . 0 1 1 ) ( ) ( 3/5 0/5 3/5 e e e
Find the probability that the waiting time (in seconds) till the next arrival of car at this intersection is less than 3 seconds.
3 0 x f (x) = y .2 11
Cumulative Distribution Function
The cumulative distribution function (c.d.f. or distribution function, d.f.) of a continuous random variable is defined as
xdt
t
f
x
X
P
x
F
(
)
(
)
(
)
• F( ) = 0, F() = 1 • P(a < X < b) = F(b) – F(a) • F′(x) = f(x), if derivative exists 12 / 0 / 1 ) ( t x x e e 0 for , 1 ) (x e x f x Example:If the p.d.f. of a continuous distribution X, waiting time between arrivals of cars at a intersection, is, where is a constant parameter of this distribution,
x dt t f x F( ) ()Find the distribution function.
x -t dt e 0 1 x e x x F x 0 , 1 0 , 0 ) ( /13
Measure of Center for a
Continuous Distribution
The mean value (expected value) of a continuous random variable (distribution)X, denoted by Xor just(or E[X]) is defined as
x
f
(
x
)
dx
X
14Measure of Spread for a
Continuous Distribution
The variance of a continuous random variable (distribution) X, denoted by X2 or just2(or Var[X]) is defined as
2 2 2 ) ( ) ( ] ) [(X x f xdx E The standard deviation of X is ] ) [( 2 2 E X 15
Moment Generating Function
for a Continuous Distribution
The moment generating function, if exists, of a continuous random variable (distribution) X, denoted by M(t) is defined ash
t
h
dx
x
f
e
e
E
t
M
tX
tx
(
)
,
]
[
)
(
16 elsewhere , 0 0.5 0 for , 8 ) (x x x f Example:If the density function of a continuous distribution is
Find the mean and variance of this distribution
3 1 ) 0 125 (. 3 8 3 8 8 5 . 0 0 3 0.5 0
x x dx x The mean is
0.5 0 ( ) ) ( ) (X x f x dx x f x dx E 17 elsewhere , 0 0.5 0 for , 8 ) (x x x f Example:If the density function of a continuous distribution is
Find the mean and variance of this distribution
The variance is 2 2 2 ]) [ ( ] [ ) (X E X E X Var 8 1 ) 0 0625 (. 4 8 4 8 8 ) ( ) ( ] [ 5 . 0 0 4 0.5 0 2 0.5 0 2 2 2
x x dx x dx x f x dx x f x X E 72 1 3 1 8 1 ]) [ ( ] [ 2 2 2 2 EX EX M ″(0) M ′(0)2 18The Percentile
The (100p)th percentile (quantile of order p) is the number ppsuch that the area under f(x) to the left of pp is p.
)
(
)
(
x
dx
F
pf
p
pp
p
pp p19
Median of a distribution Example:
If the density function of a continuous distribution is
Find the median of this distribution. elsewhere , 0 0.5 0 for , 8 ) (x x x f 0.5 x 0 f (x) = y 20 Median is c such that
What is c?
5
8
0x
dx
.
c
354 . 8 1 4 / 5 . 5 . 0 4 5 . 2 8 8 2 2 0 2 0
c c c x dx x c c 21 Percentile Example:If the density function of a continuous distribution is
Find the 25th percentile of this distribution.
elsewhere , 0 0.5 0 for , 8 ) (x x x f 0.5 0 x f (x) = y 22 25th percentile is c such that
What is c?
25
.
8
0
cdx
x
25 . 16 1 4 / 25 . 25 . 0 4 25 . 2 8 8 2 2 0 2 0
c c c x dx x c c 23Sample Quantile
Let y1 y2 ...yn be the order statistics associated with the sample x1, x2, ···, xn , thenyr is called the sample quantile of order
as well as percentile. 1 n r 1 100 n r Example: 1, 3, 7, 8, 9, 13
n = 6, and the value 8, y4 ,
is the [4/(6+1)]th quantile of the distribution of the sample, i.e. 0.571 sample quantile or 57.1 percentile.
n r.5 25 . 375 . n r Other options: 24
Examine Distribution with
Quantile-Quantile Plot
Good model for the observations
Not a good model for the observations Theoretical Distribution, pp Sample, yr Sample, yr Theoretical Distribution, pp
25
Continuous Distributions
2 The Uniform and ExponentialDistributions
26
Uniform Distribution
The continuous random variable X has a uniform distribution if its p.d.f. is equal to a constant on its support. If the support is the interval [a, b], then its p.d.f. is.
,
1
)
(
a
x
b
a
b
x
f
It is usually denoted as U(a, b). a b a b 1 f(x) 0 a b F(x) 1 0 27Uniform Distribution
The mean, variance, and m.g.f. of a continuous random variable X that has a uniform distribution are: . 0 , 1 , 0 , ) ( ) ( , 12 ) ( , 2 2 2 t t a b t e e t M a b b a ta tb
Pseudo-Random Number Generator on most computers U(0, 1)
28
Uniform Distribution
Example: Let X be U(0,10), find the mean and the variance, and the m.g.f. of X. . 0 , 1 , 0 , 10 1 ) ( , 3 25 12 ) 0 10 ( , 5 2 10 0 10 2 2 t t t e t M t 29
Exponential Distribution
The continuous random variable X has an exponential distribution if its p.d.f. is elsewhere , 0 0 for , 1 ) ( / x x x f x
where is the mean of the distribution. * X can be the waiting time until next success in a Poisson process.
30
Exponential Distribution
The mean, variance, and m.g.f. of a continuous random variable X that has an exponential distribution are: 1 , 1 1 ) ( , , 2 2 t t t M x e x x F x 0 , 1 0 , 0 ) ( / c.d.f.
31
Exponential Distribution
Example: Let X have an exponential distribution with a mean of 30, what is the first quartile of this distribution? x e x x F x 0 , 1 0 , 0 ) ( /30 p.25/ = ln(.75) p.25 = ·ln(.75) p.25 = 30·ln(.75) {= 30} p.25 =8.63 75 . 25 . 1 ) ( .25 / / 2 5 . 2 5 . p p p e e F pp = · ln(1 – p) 32Exponential Distribution
Let W be the waiting time until next success in a Poisson process in which the average number of success in unit interval is l, then, for w 0F(w) = P(Ww) = 1 – P(W > w) = 1 – P(W > w) = 1 – P(nosuccess in[0,w]) = 1 – e-lwd.f. of exponential distribution. F (w) = f(w) = le-lw p.d.f. of exponential distribution. / 1 x e 33
Exponential Distribution
Let W be the waiting time until next success in a Poisson process in which the average number of success in unit interval is l, then, l = 1/, where is the average waiting time until next success, for w 0 F(w) = 1 – e-lw =1 – e-w/ f(w) = p.d.f. of exponential distribution. / 1ew d.f. of exponential distribution. 34Exponential Distribution
Suppose that number of arrivals ofcustomers follows a Poisson process with a mean of 10 per hour. What is the probability that the next customer will arrive within 15 minutes? (15 min. = 0.25 hour)
l= 10 = 0.1 P(X x) = F (x) = 1 – e-x/ P(X 0.25) = F (0.25) = 1 – e-0.25/ F (0.25) = 1 – e-0.25/0.1= .918 35
Continuous Distributions
3 The Gamma and Chi-squareDistributions
36
Gamma Distribution
The continuous random variable X has a Gamma distribution,Gamma(a, ). if its p.d.f. is elsewhere. , 0 0 for , ) ( 1 ) ( / 1e x x x f x a a a* X can be the waiting time until ath success in a Poisson process.
37
Graphs of Gamma Distributions
a = 1/4 a = 1 a = 2 a = 3 a = 4 = 5/6 = 2 = 4 = 4 a = 4 = 1 = 3 0 10 20 30 0 10 20 30 38
Gamma Distribution
The mean, variance, and m.g.f. of a continuous random variable X that has an Gamma distribution are: a a a 1 , ) 1 ( 1 ) ( , , 2 2 t t t M
•Gamma(1, ) Exponential Distribution •Gamma(2, r/2 ) Ch-square with d.f. = r.
39 40
Special Notation
c
2 a(
r
)
c2 a(r) Probability of X greater than or equal to c2a(r) is a.a
c
a
(
)]
[
2 1r
X
P
Example: Findc2 .05(3) = ? Tail areaa
c
a
(
)]
[
X
2r
P
Let X be a random that has Chi-square distribution with degrees of freedom r, 7.815 41
Try This!
• Findc2 .01(7) = ? • Findc2 .025(4) = ?• Find the 10th percentile from a c2 distribution with degrees of freedom 6.
42
Continuous Distributions
4 Distributions of Functions ofRandom Variable
43
A Good Generator
• Simple
• Widespread use
• Long cycle length 231 – 2 (all number besides 1 and 231 – 1 can be generated.) • Ui= Xi/(231 – 1), U
i ~ U(0,1)
Xi = (397,204,094Xi-1) mod (231 – 1)
Starts with a Seed number
44
Methods for Generating
Non-Uniform RN’s
• CDF Inversion • Transformations • Accept/Reject Methods • … 45CDF Inversion
Theorem: Let U have a distribution that is
U(0,1). Let F(x) have the properties of a distribution function of the continuous type with
F(a) = 0 and F(b) = 1, and suppose that F(x) is strictly increasing on the support a < x < b, where a and b could be and ,
respectively. Then the random variable X
defined by X = F 1(U) is a continuous random variable with distribution function F(x).
46
Proof:
Let X = F 1(U) , the distribution function of X is
P (Xx ) = P [ F1(U) x ], a < x < b .
Since F (x) is strictly increasing, { F1(U) x } is
equivalent to { UF (x) } and hence
P ( X x ) = P [ U F (x) ], a < x < b .
But U is U(0, 1); so P ( U u ) = u for 0 < u < 1, and accordingly,
P ( X x ) = P [ UF (x) ] = F (x) , 0 F(x) < 1.
That is the distribution function of X is F(x).
47
Generate random numbers from
Exponential distribution,
= 10
• F(x) = 1 ex/10 and x =F1(y) = 10·ln(1y)
• Use uniform U(0, 1) random number generator to generate random numbers y1, y2, ..., yn .
• The exponentially distributed random numbers xi's
would be xi= 10·ln(1yi) , i = 1, ..., n.
• Therefore, if the uniform random number generator generates a number 0.1514, then 1.6417 = 10·ln(1 0.1514) would be a random observation from exponential distribution with = 10.
48
Try this!!!
1. Use the CDF Inversion method to convert this
U(0,1) random number to simulate an observation from an exponential distribution with = 12.
xi= F1(yi) = 12·ln(1yi)
2. Use CDF Inversion method to generate a random number from the continuous random variable that has the following p.d.f. elsewhere , 0 0.5 0 for , 8 ) (x x x f
An U(0,1) random number generator has generated a value of 0.26.