0% found this document useful (0 votes)
36 views

IV. Triangular Distribution: Minimum Mode Maximum

The triangular distribution is defined by three parameters: the minimum (a), mode (b), and maximum (c). It has a piecewise linear probability density function between a and b, and between b and c. The expected value is (a + b + c)/3. The gamma distribution is a generalization of the exponential distribution defined by shape (α) and scale (β) parameters. It has a probability density function involving the gamma function. The expected value is αβ and variance is αβ2, allowing α and β to be determined from estimates of the mean and standard deviation.

Uploaded by

Avinash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

IV. Triangular Distribution: Minimum Mode Maximum

The triangular distribution is defined by three parameters: the minimum (a), mode (b), and maximum (c). It has a piecewise linear probability density function between a and b, and between b and c. The expected value is (a + b + c)/3. The gamma distribution is a generalization of the exponential distribution defined by shape (α) and scale (β) parameters. It has a probability density function involving the gamma function. The expected value is αβ and variance is αβ2, allowing α and β to be determined from estimates of the mean and standard deviation.

Uploaded by

Avinash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

IV.

Triangular Distribution

Known values are the minimum (a), the mode (b - the most likely value of
the pdf), and the maximum (c).
probability density function
(area under the curve = 1)

f(x)
2
h=
c-a

a b c x

 2(x - a) h
 (c - a)(b - a) for a ≤ x ≤ b (slope = b - a )
The pdf is given by f(x) = 
 − 2( x - c) for b ≤ x ≤ c (slope = − h )
 (c - a)(c - b) c- b
= 0 otherwise

The expected value is given by


∞ b c
2(x - a) 2(c - x) a + b +c
E(X) = ∫ x ⋅ f(x)dx = ∫ ⋅ xdx + ∫ ⋅ xdx =
(c - a)(b - a) (c - a)(c - b) 3
-∞ a b
The derivation is fairly tedious; with a little work it can be shown that
 2b 3 - 3ab 2 + a 3 c 3 - 3cb 2 + 2b 3  a 3 (c - b) + b 3 (a - c) + c 3 (b - a)
E(X) = h ⋅  + =
 6(b - a) 6(c - b)  3(c - a)(b - a)(c - b)
(a + b + c)(c - a)(b - a)(c - b) a + b + c
= =
3(c - a)(b - a)(c - b) 3

Remark:

For a discrete sample, measures of centrality that are typically


determined are the mean, the mode, and the median. The mean is the
average value of the sample and corresponds to E(X). The mode
corresponds to the maximum value of the pdf. When working with a
sample, it is necessary to resort to a histogram (which can be tricky) to
estimate the mode of the underlying pdf. The median simply
corresponds to that point at which half of the area under the curve is to
the left and half is to the right. The triangular distribution is typically
employed when not much is known about the distribution, but the
minimum, mode, and maximum can be estimated.
Sampling from the triangular distribution requires solving
rsample

x= ∫ f(z)dz
-∞

for rsample given random probability x.

Since f(z) is piecewise continuous, its distribution function F(t) is given by

 0 for t ≤ a
t
∫ f(z)dz for a < t ≤ b
t
a
F(t) = ∫ f(z)dz =  c
 1 - f(z)dx
 ∫
−∞ for b ≤ t < c
 t
 1 for t ≥ c

Hence, for a ≤ rsample ≤ b we get

rsample rsample rsample


2(z − a) z 2 - 2az (rsample - a) 2
A x= ∫ f(z)dz = ∫ (b − a)(c − a)
dz =
(b - a)(c - a)
=
(b - a)(c - a)
a a a

and for b ≤ rsample ≤ c, since


c c c
2(c − z) 2cz - z 2 (c - rsample) 2
∫ f(z)dz = ∫ (c − b)(c − a) dz = (c - b)(c - a) =
(c - b)(c - a)
rsample rsample rsample

we get

(c - rsample) 2
B x = 1-
(c - b)(c - a)

Since
b
(b - a)
∫ f(z)dz = (c - a)
a
(b - a)
if the random probability x ≤ then equation A is used to solve for
(c - a)
rsample; otherwise equation B is used.

A rsample = a + (b - a)(c - a)x for x ≤ (b - a)/(c - a)


B rsample = c - (c - b)(c - a)(1 - x) for x > (b - a)/(c - a)
Graphically, the sampling function has the appearance

rsample
c

x
0 1

(b-a)/(c-a)
Example: (Note: the median corresponds to x= 0.5)
For a=1, b = 2, c = 4
mean = (a+b+c)/3 = 2.333
mode = 2
median = c − (c − b)(c − a)(0.5) = 4 - 3 = 2.268

V. Gamma Distribution

A large number of useful functions are related to the exponential function.


The gamma function is one of these. The gamma function generally traces
from 18th century work by Euler in which he was using interpolation methods
to define n! for non-integral values (it was later dubbed the gamma function
by LeGendre in a series of books published between 1811 and 1826). The
gamma function appears naturally in the study of anti-differentiation; i.e., it is
also studied in the context of differential equations when calculating LaPlace
transforms. The gamma function is given by

Γ(α) = ∫ x α - 1e − x dx (α > 0)
0
Integrating by parts, we get

Γ(α) = (α-1)Γ(α-1) for α > 1.



Since Γ(1) = ∫ e - x dx = 1 , then when α is an integer, Γ(α) = (α - 1)!
0
Hence, the gamma function is a generalization of the factorial, applying to all
α > 0, not just integers.
The gamma distribution is obtained from the gamma function by specifying
the pdf
 −
x
 α-1 ß
f(x) = kx e for x > 0 for fixed α > 0 and β > 0
 0
 otherwise

where the proportionality constant k is chosen so that ∫ f(x)dx = 1 .
−∞
k is easy to figure:

∞ x ∞
-
α-1
1= k ∫ x e ß
dx = kß α ∫ t α - 1e - t dt where x = βt .
0 0
Γ(α)
1 1
so k = and f(x) is given by x α − 1 e- x/ß
α
ß Γ( α) ß Γ(α)
α

α is called shape (or order) parameter; β us called the scale parameter.


1
1 - ⋅x
Note that when α = 1, f(x) = ⋅ e ß which is the exponential distribution
ß
with mean β.

In general, E(X) = αβ and σ2 = αβ2 . Hence, if the mean and standard


deviation can be estimated, then α and β can also be determined.

Algorithm for calculating the natural logarithm of the gamma function


Attributed to Lanczos, C., Journal S.I.A.M. Numerical Analysis,
ser. B, vol. 1, p. 86 (1964)
and adapted from Numerical Recipes in C by Press, W.H., and B.P. Flannery,
S.A. Teukolsky, W.T. Vetterling (Cambridge University Press, 1988).
FUNCTION lngamma(z)
/* Use the reflection formula for z < 1 */
IF z < 1
z← 1 - z
RETURN ln(πz) - (lngamma(1 + z) + ln(sin(πz))
ENDIF
coeff ← 76.18009173, -86.50532033, 24.01409822, -1.231739516, 0.00120858003, -0.00000536382
/* These values are the (approximate) coefficients for the first 6 terms of an infinite series
involved in an exact formulation for the gamma function credited to Lanczos. They yield an
approximation for the variable "a" (determined below) which is within |ε| < 2 × 10-10 of its true
value */
a←1
FOR i ← 1 TO 6
a ← a + coeff(i)/(i + z - 1)
ENDFOR
RETURN ln(a 2p ) - (z + 4.5) + (z - 0.5)ln(z + 4.5)
END
Gamma pdf for fixed mean αβ = 5 and varying values of α and β
f(x)
0.6

0.5
α=.5, β=10
0.4
α=1.5, β=3.3333
α=5, β=1
0.3
α=10, β=.5
0.2

0.1

0 x
0 5 10

Corresponding distribution functions and sampling functions


F(x)
rsample
10
1

.6

.2
4
0
0 10
2

0
0 .2 .6 1

The gamma distribution is used to model waiting times or time to complete a


task. More specifically, it can be shown that if we have exponentially distributed
interarrival times with mean 1/λ, the time needed to obtain k changes distributes
according to a gamma distribution with α = k and β = 1/λ.

Gamma Function: Γ(α ) = ∫ x α - 1 e - x dx (α > 0)
0

The general relationship Γ(α) = (α-1)Γ(α-1) for α > 1 holds.


π
It can also be shown that Γ(α )Γ (1 -α ) = for 0 < α < 1.
sin( π ⋅ α)
(Note that in particular, this means that Γ(.5) = π )

For 0 < α < 1, 1 + α > 1, so Γ(1+α) = αΓ(α).

This in turn gives the reflection formula


π⋅α
Γ(1 - α) = for 0 < α < 1
Γ(1 + α )sin( π ⋅ α)

Selected values computed according to the algorithm for ln(Γ(α)).

Γ(.25) ≈ 3.62560991 Γ(α)


Γ(.5) = π ≈ 1.77245385
10
Γ(.75) ≈ 1.22541670
Γ(1) = 0! = 1
Γ(1.25) ≈ 0.90640248 8
Γ(1.5) = .5Γ(.5) = π/2 ≈ 0.88622693
Γ(1.75) ≈ 0.91906253
Γ(2) = 1! = 1 6 x
3!
Γ(2.25) ≈ 1.13300310 0! 1! 2!
Γ(2.5) = 1.5Γ(1.5) = 3 π / 4 ≈ 1.32934039 4
Γ(2.75) ≈ 1.60835942
Γ(3) = 2! = 2
Γ(3.25) ≈ 2.54925697 2 x
Γ(3.5) = 2.5Γ(2.5) = 15 π / 8 ≈ 3.32335097 x x
Γ(3.75) ≈ 4.42298841 0 α
Γ(4) = 3! = 6 0 1 2 3 4 5
Γ(4.25) ≈ 8.28508514
Γ(4.5) = 3.5Γ(3.5) = 105 p /16 ≈ 11.63172840
Γ(4.75) ≈ 16.58620654
Γ(5) = 4! = 24
Γ(5.25) ≈ 35.21161185
Γ(5.5) = 4.5Γ(4.5) = 945 π /32 ≈ 52.34277778
Γ(5.75) ≈ 78.78448105
Γ(6) = 5! = 120
For the pdf of the gamma distribution
 −
x
 α-1 ß
f(x) = kx e for x > 0 for fixed α > 0 and β > 0
 0
 otherwise
note that if:
α < 1 then xα - 1 → ∞ as x → 0
α = 1 then the distribution is the exponential distribution
α > 1 then xα - 1 → 0 as x → 0
The earlier example showed three basic shapes, each of which is described by
the behavior of the derivative f '(x) (slope function) of f(x).
f '(x) = k[(α - 1)xα - 2 e-x/β + (-1/β)xα - 1 e-x/β ]
There are actually 5 cases:
α < 1 the slope → -∞ as x → 0
since each term is < 0 and each exponent of x is < 0
α = 1 the slope → -1/β 2 as x → 0 in accord with the exponential distribution
since k = 1/β, term 1 is 0 and term 2 is -1/β
α < 2 and α > 1 the slope → +∞ as x → 0
since the lead term → +∞ and term 2 is 0
α = 2 the slope → +1/β 2 as x → 0
since k = 1/β α = 1/β 2
α > 2 the slope → 0 as x → 0
In each case the slope → 0 as x → +∞

The gamma distribution is one which is usually sampled by the accept-reject


technique, which means to get k, the value of Γ(α) must be computed.

VI. Erlang Distribution

Erlang was a Danish telephone engineer who did some of the early work in
queuing theory. When α is an integer i, then the gamma distribution is called an
Erlang distribution of order i. The Erlang distribution is used to model
phenomena having i stages, each with independent, exponentially distributed
service times of mean µ. Rather than model these separately, an Erlang
distribution of order i can be used to model the total service time; e.g., if an
experiment has 3 successive stages each of which takes an average of 5 minutes
(exponentially distributed), then the experiment time can be modeled by taking α
= 3 and β = 5 (to get the overall mean of αβ = 15 minutes).
VII. Weibull Distribution

Recall that for the gamma distribution the idea was to choose k so that

k ∫ x α - 1 e - x/ ß dx is equal to 1 and then choose f(x) = kxα-1e-x/β.
0
A major difficulty with this pdf is that it is not integrable in closed form;
however, it is close to being so. The idea is to render the part under the
integral to be in the form ezdz so that the function will be integrable; i.e.,
for

k ∫ e − (x/ ß ) x α- 1 dx we need to determine a ? value so that
?

0
for z = -(x/β)?, dz = xα-1dx

If z = -(x/β)α then dz = -(α/β)(x/β)α - 1dx and then

 - ß α  ∞ − (x/ ß )α  − α   - ß α   −( x/ß )α  ∞  ßα 
k  ⋅ e ( )α- 1   e   = 1 when k = α
 ∫ 
 
 x/ ß dx = k     0
= k  α ßα
 α  0  ß   α   

This forms the basis for the Weibull distribution, which has the pdf

 α - 1 - x - δ 
α

 α  x − δ   ß 
f(x) =    e 
for x ≥ d
ß ß 

 0 otherwise

Remark: the effect of δ is to displace the distribution δ along the


horizontal axis, so it is often taken to be 0.

With a little work, it can be shown that


E(X) = δ + βΓ(1 + 1/α) and
VAR(X) = β 2 (Γ(1 + 2/α) - Γ2 (1 + 1/α))

Since
rsample rsample

f(z)dz = - e - (( x - δ )/ß )  = 1 - e - (( rsample - δ)/ß )α


α
x= ∫  
δ δ
the sample function can be solve for rsample for given values of α, β, δ.

The Weibull distribution is often used to model time until failure (for
example, light bulbs may have significant early failure and some have
significant long term until failure) as per the following graph. When α = 1,
β = 1/λ, δ = 0 then the Weibull distribution is the exponential distribution.
Weibull pdf for fixed β = 1 and varying values of α

f(x)
4

α=10, β=1
3

α=.5, β=1
2
α=5, β=1

1
α=1.5, β=3.3333

0 x
0 1 2 3 4

You might also like