03-Continuous Distributions
03-Continuous Distributions
Lecture’s Objectives
Continuous Distributions
Z b
P(a ≤ X ≤ b) = f (x)dx
a
Z x
F (x) = P(X ≤ x) = f (u)du
−∞
Z +∞
µ = E(X ) = xf (x)dx
−∞
Z +∞ h i2
2 2
σ = E (X − µ) = (x − µ)2 f (x)dx = E(X 2 ) − E(X )
−∞
1
A continuous RV X with pdf f (x) = , a ≤ x ≤ b is a
b−a
continuous uniform random variable.
(b − a)2
µ = E(X ) = and σ 2 = Var(X ) =
12
0 x <a
F (x) = a≤x <b
1 b≤x
Solution:
P(X ≥ 12.5) =
PDF Curve
2.0
1.5
f(x)
1.0
0.5
0.0
Probability of an Interval
Z 12.75
P(X ≥ 12.5) = f (x)dx = 0.125
12.5
2.0
1.5
f(x)
1.0
0.5
0.0
x
© 2023 M. J. Feizollahi, All Rights Reserved Continuous Probability Distributions 10 / 48
Intro Uniform Normal Exponential Erlang Gamma Weibull Lognormal Chi-square t F
CDF
Z x
F (x) = f (u)du
−∞
0.0 0.2 0.4 0.6 0.8 1.0
F(x)
x
© 2023 M. J. Feizollahi, All Rights Reserved Continuous Probability Distributions 13 / 48
Intro Uniform Normal Exponential Erlang Gamma Weibull Lognormal Chi-square t F
1 > F<-function(x){
2 + y<-x
3 + pts<- length(x)
4 + for(i in 1:pts){
5 + ifelse( x[i]<11.75, y[i]<-0,
6 + ifelse( x[i] <= 12.75,
7 + y[i]<-( integrate(f, lower = 11.75,
8 + upper = x[i])$val), y[i]<-1))
9 + }
10 + return(y)
11 + }
12 > curve(F, from=11.5, to=13,n=1001)
Normal Distribution
A RV X with pdf
1 −(x−µ)2
f (x) = √ e 2σ2 , x ∈ R
2πσ
is a normal random variable with parameters µ and σ, where
µ ∈ R, and σ > 0.
E(X ) = µ and Var(X ) = σ 2
X ∼ N(µ, σ 2 ) means X has a normal pdf with parameters µ
and σ.
Normal PDF
f (x)
! – 3! µ – 2! !–! ! ! + ! ! + 2! ! + 3! x
68%
95%
99.7%
© 2023 M. J. Feizollahi, All Rights Reserved Continuous Probability Distributions 16 / 48
Intro Uniform Normal Exponential Erlang Gamma Weibull Lognormal Chi-square t F
x −µ
where z = is the z-value obtained by standardizing X .
σ
Example
Example
f (x) Specifications
Another Example
Solution
Let Y1 ∼ N(µ1 , σ12 ), Y2 ∼ N(µ2 , σ22 ) and Y3 ∼ N(µ2 , σ22 )
denote normal RVs corresponding to the length of shafts 1, 2,
and 3, respectively.
Let X denotes the RV for the linkage length.
Then X ∼ N(µ, σ 2 ) where,
µ = µ1 + µ2 + µ3 = 75 + 60 + 25 = 160 and
σ 2 = σ12 + σ22 + σ32 = 0.09 + 0.16 + 0.25 = 0.5. Therefore,
X ∼ N(160, 0.5). √
P(X > 160.5) = P(Z > 160.5−160
√
0.5
) = P(Z > 0.5) = 0.23975
Solution in R
n = 10
p = 0.5
0.20
0.15
f(x)
0.10
0.05
0.00
©
0 1 2 3 4 5 6 7 8 9 10
x
2023 M. J. Feizollahi, All Rights Reserved Continuous Probability Distributions 22 / 48
Intro Uniform Normal Exponential Erlang Gamma Weibull Lognormal Chi-square t F
Example
λ = 1000
950 −1000
X e 1000x
P(X ≤ 950) =
x!
x=0
950 − 1000
≈ P(Z ≤ √ ) = P(Z ≤ −1.5811) = 0.057
1000
© 2023 M. J. Feizollahi, All Rights Reserved Continuous Probability Distributions 26 / 48
Intro Uniform Normal Exponential Erlang Gamma Weibull Lognormal Chi-square t F
Y = c1 X1 + c2 X2 + · · · + cn Xn
is a linear combination of X1 , X2 , · · · , Xn .
If X1 , X2 , · · · , Xn are independent
E(Y ) =
and
Var(Y ) =
Exponential Distribution
1
F (x) = , µ = E(X ) = and σ 2 = Var(X ) =
λ2
λ
2
0.5
1.6 0.1
1.2
f (x)
0.8
0.4
0.0
0 2 4 6 8 10 12
x
© 2023 M. J. Feizollahi, All Rights Reserved Continuous Probability Distributions 31 / 48
Intro Uniform Normal Exponential Erlang Gamma Weibull Lognormal Chi-square t F
Erlang Distribution
r λ
1 1
1.6 5 1
5 2
1.2
f (x)
0.8
0.4
0.0
0 2 4 6 8 10 12
x
Gamma Distribution
The Erlang distribution is a special case of the gamma
distribution. If the parameter r of an Erlang RV is not an
integer, but r > 0, the RV has a gamma distribution.
Need a generalization of the factorial function
Gamma function:
Z ∞
Γ(r ) = x r −1 e −x dx, for r > 0
0
Γ(r ) = (r − 1)Γ(r − 1) for r ∈ R++
Γ(r ) = (r − 1)! for r ∈ N
λr x r −1 e −λx
Gamma RV X has pdf f (x) = with parameters λ > 0
Γ(r )
and r > 0. For integer r , X has an Erlang distribution.
r r
and σ 2 = Var(X ) = 2
© µ = E(X ) =
2023 M. J. Feizollahi, All Rights Reserved λ λ
Continuous Probability Distributions 34 / 48
Intro Uniform Normal Exponential Erlang Gamma Weibull Lognormal Chi-square t F
r λ
1 1
1.6 8.3 2
7.5 3.75
1.2
f (x)
0.8
0.4
0.0
0 2 4 6 8 10 12
x
Weibull Distribution
Weibull Distribution
δ β
1 1
0.8 3.4 2
4.5 6.2
0.6
f (x)
0.4
0.2
0.0
0 3 6 9 12 15
x
Lognormal Distribution
2 /2 2 2
E(X ) = e θ+ω and Var(V ) = e 2θ+ω (e ω − 1)
The lifetime of a product that degrades over time is often modeled
by a lognormal RV.
Chi-square Distribution
λr x r −1 e −λx
Note that a gamma RV X has pdf f (x) = with
Γ(r )
parameters λ > 0 and r > 0.
Then, chi-square distribution is a special case of gamma
distribution with parameters λ = 1/2 and r = ν/2.
E(X ) = and Var(X ) = .
Which Chi-square distribution is equivalent to an exponential
distribution?
f (x)
k=2
k=5
k = 10
0 5 10 15 20 25 x
Student’s t Distribution
Γ ν+1
2
f (x) =
√ x2 ( ν+1 ) , x ∈ R
ν 2
πνΓ 2 ν +1
ν
E(X ) = 0 and Var(X ) = , for ν > 2
ν−2
Shape of t Distribution
Comparison of t Distributions
0.4
Distributions
df=1
df=3
df=8
df=30
0.3
normal
0.2
f(x)
0.1
0.0
-4 -2 0 2 4
x value
F Distribution
W /u
F =
Y /v
v 2v 2 (v + v − 2)
E(X ) = , for v > 2 and Var(X ) = , for v > 2
v −2 u(v − 2)2 (v − 4)
© 2023 M. J. Feizollahi, All Rights Reserved Continuous Probability Distributions 45 / 48
Intro Uniform Normal Exponential Erlang Gamma Weibull Lognormal Chi-square t F
Shape of F Distribution
f (x)
u = 5, v = 5
u = 5, v = 15
0 2 4 6 8 10 x
Continuous Distributions in R
Distribution cdf in R
Beta pbeta
Cauchy pcauchy
Chi-Square pchisq
Exponential pexp
F pf
Gamma pgamma
Lognormal plnorm
Normal pnorm
Pareto ppareto (Package: actuar)
t pt
Uniform punif
Weibull pweibull