Erlang, Hyper-exponential, and Coxian distributions

28
1 Erlang, Hyper- exponential, and Coxian distributions Mixture of exponentials Combines a different # of exponential distributions Erlang Hyper-exponential Coxian μ μ μ μ E 4 Service mechanism H 3 μ 1 μ 2 μ 3 P 1 P 2 P 3 μ μ μ μ C 4

description

Erlang, Hyper-exponential, and Coxian distributions. Mixture of exponentials Combines a different # of exponential distributions Erlang Hyper-exponential Coxian. μ. μ. μ. E 4. μ. Service mechanism. μ 1. P 1. μ 2. H 3. P 2. P 3. μ 3. μ. μ. μ. μ. C 4. - PowerPoint PPT Presentation

Transcript of Erlang, Hyper-exponential, and Coxian distributions

Page 1: Erlang, Hyper-exponential, and Coxian distributions

1

Erlang, Hyper-exponential, and Coxian distributions

Mixture of exponentials Combines a different # of exponential distributions

Erlang

Hyper-exponential

Coxian

μ μ μ μ E4

Service mechanism

H3

μ1

μ2

μ3

P1

P2

P3

μ μ μ μC4

Page 2: Erlang, Hyper-exponential, and Coxian distributions

2

Erlang distribution: analysis

Mean service time E[Y] = E[X1] + E[X2] =1/2μ + 1/2μ = 1/μ

Variance Var[Y] = Var[X1] + Var[X2] = 1/4μ2 v + 1/4μ2 = 1/2μ2

1/2μ 1/2μ

E2

2

*

**

22

21

2

2)(

.2

.2)()(

..2)(;..2)(

21

2

2

1

1

ssf

ssfsf

exfexf

Y

XX

xX

xX

Page 3: Erlang, Hyper-exponential, and Coxian distributions

3

Squared coefficient of variation: analysis

X is a constant X = d => E[X] = d, Var[X] = 0 => C2 =0

X is an exponential r.v. E[X]=1/μ; Var[X] = 1/μ2 => C2 = 1

X has an Erlang r distribution E[X] = 1/μ, Var[X] = 1/rμ2 => C2 = 1/r

fX *(s) = [rμ/(s+rμ)]r

C2

0

constant

1

exponential

Hypo-exponential

Erlang

Page 4: Erlang, Hyper-exponential, and Coxian distributions

4

Probability density function of Erlang r

Let Y have an Erlang r distribution

r = 1 Y is an exponential random variable

r is very large The larger the r => the closer the C2 to 0

Er tends to infintiy => Y behaves like a constant

E5 is a good enough approximation

)!1(

.)...()(

..1

r

eyrryf

yrr

Y

Page 5: Erlang, Hyper-exponential, and Coxian distributions

5

Generalized Erlang Er

Classical Erlang r E[Y] = r/μ

Var[Y] = r/μ2

Generalized Erlang r Phases don’t have same μ

rμ rμ … rμ

Y

μ1 μ2… μr

Y

))...()((

...

.....)(

21

21

2

2

1

1*

r

r

r

rY

sss

ssssf

Page 6: Erlang, Hyper-exponential, and Coxian distributions

6

Generalized Erlang Er: analysis

If the Laplace transform of a r.v. Y Has this particular structure

Y can be exactly represented by An Erlang Er

Where the service rates of the r phase Are minus the root of the polynomials

))...()((

...)(

21

21*

r

rY ssssf

Page 7: Erlang, Hyper-exponential, and Coxian distributions

7

Hyper-exponential distribution

P1 + P2 + P3 +…+ Pk =1

Pdf of X?

μ1

μ2

P1

P2

Pk μk

.

.

X

k

i

xii

XkXX

i

k

eP

xfPxfPxf

1

.

1

..

)(....)(.)(1

Page 8: Erlang, Hyper-exponential, and Coxian distributions

8

Hyper-exponential distribution:1st and 2nd moments

22

12

2

1

1

*

][][][

2.][

][

.)(

XEXEXVar

PXE

PXE

sPsf

k

i i

i

k

i i

i

k

i i

iiX

Example: H2

2

2

2

1

122

221

1

22

221

12

2

2

1

1

2.

2.][

2.

2.][

][

PPPPXVar

PPXE

PPXE

Page 9: Erlang, Hyper-exponential, and Coxian distributions

9

Hyper-exponential: squared coefficient of variation

C2 = Var[X]/E[X]2

C2 is greater than 1

Example: H2 , C2 > 1 ?

0)11

(211

0.

..2)1()1(

0.

..2

11)//(

/2/2

2

212122

21

21

2122

2221

11

21

2121

22

21

21

22

221

1

22211

222

2112

PPPPPP

PPPPPP

PP

PPC

Page 10: Erlang, Hyper-exponential, and Coxian distributions

10

Coxian model: main idea

Idea Instead of forcing the customer

to get r exponential distributions in an Er model

The customer will have the choice to get 1, 2, …, r services

Example C2 : when customer completes the first phase

He will move on to 2nd phase with probability a Or he will depart with probability b (where a+b=1)

a

b

Page 11: Erlang, Hyper-exponential, and Coxian distributions

11

Coxian model

μ1 μ2 μ3 μ4a1

b1 b2 b3

a2 a3

μ1

μ1

b1

a1 b2 μ2

μ1 μ2 μ3

a1 a2 b3

μ1 μ2 μ3 μ4

a1 a2 a3

Page 12: Erlang, Hyper-exponential, and Coxian distributions

12

Coxian distribution: Laplace transform

Laplace transform of Ck

Is a fraction of 2 polynomials The denominator of order k and the other of order < k

Implication A Laplace transform that has this structure

Can be represented by a Coxian distribution Where the order k = # phases, Roots of denominator = service rate at each phase

korderPolynomial

korderPolynomial

_

_

k

i

i

l l

lii sbaaaaasf

1 112100

* ....)(

Page 13: Erlang, Hyper-exponential, and Coxian distributions

13

Coxian model: conclusion

Most Laplace transforms Are rational polynomials

=> Any distribution can be represented Exactly or approximately

By a Coxian distribution

Page 14: Erlang, Hyper-exponential, and Coxian distributions

14

Coxian model: dimensionality problem

A Coxian model can grow too big And may have as such a large # of phases

To cope with such a limitation Any Laplace transform can be approximated by a c

To obtain the unknowns (a, μ1, μ2) Calculate the first 3 moments based on Laplace transform

And match these against those of the C2

a

b=1-a

μ1 μ2

Page 15: Erlang, Hyper-exponential, and Coxian distributions

15

C2 : first three moments

32

31

3212121

31

3

22

21

22121

21

2

21

)(6)(126][

)(22.2][

1][

aabXE

aabXE

aXE

Page 16: Erlang, Hyper-exponential, and Coxian distributions

16

Rational polynomials approximated by Coxian-2 (C2)

The Laplace transforms of most pdfs Have the following shape

Can be exactly represented by A Coxian k (Ck) distribution

The # stages = the order of the denominator Service rates given by the roots of the denominator

If k is very large => dimensionality problem Solution: collapse the Ck into a C2

korderPolynomial

korderPolynomial

_

_

a

b=1-a

μ1 μ2

Page 17: Erlang, Hyper-exponential, and Coxian distributions

17

3 moments method The first way of obtaining the 3 unknowns (μ1 μ2 a)

3 moments method Let m1, m2, m3 be the first three moments

of the distribution which we want to approximate by a C2

The first 3 moments of a C2 are given by

by equating m1=E(X), m2=E(X2), and m3 = E(X3), you get

32

31

3212121

31

3

22

21

22121

21

2

21

)(6)(126][

)(22.2][

1][

aabXE

aabXE

aXE

Page 18: Erlang, Hyper-exponential, and Coxian distributions

18

3 moments method: solution The following expressions will be obtained

However, The following condition has to hold: X2 – 4Y >= 0

=> 3 < 2m1m3

=> the 3 moments method applies to the case where c2 > 1 for the original distribution

1

2

13

1

22

1

21

12

2

1

111

2

2

1;

46

36

;2

4

)1.(

m

Ym

mX

mmm

mmm

Y

XYXX

ma

22m

Page 19: Erlang, Hyper-exponential, and Coxian distributions

19

Two-moment fit

If the previous condition does not hold You can use the following two-moment fit

General rule Use the 3 moments method

If it doesn’t do => use the 2 moment fit approximation

21

21

1

2

.

1;

2.2

1

cmm

ca

Page 20: Erlang, Hyper-exponential, and Coxian distributions

20

M/C2/1 queue

What is the state of the system? How many variables are needed to

Describe the state of this queue?

A 2-dimensional state (n1 ,n2) is needed n1 represents the number of customers in the queue

n2 is the state of the server 0 => server is idle; 1 => the server is busy in phase 1

2 => server is busy in phase 2

μ μ C2a

b

Page 21: Erlang, Hyper-exponential, and Coxian distributions

21

M/C2/1 queue: analysis

To analyze this queue, one must go thru Rate diagram that depicts state transition

Steady state equations Derive the balance equations

Based on these equations Obtain the generating functions

Using a recursive scheme Solve the M/C2/1 queue and

Determine P(n) = Pn = prob of having n customers in system

Page 22: Erlang, Hyper-exponential, and Coxian distributions

22

M/C2/1: state diagram (n1 , n2)

Where n1 is the # customers in the queue Excluding the one in service

n2 is the state of the server (0:idle, 1:phase1, 2:phase2)0,0

0,1

1,1

2,1

.

.

.

0,2

1,2

2,2

.

.

.

λ

λ

λ

λ

λ

μ2

μ2

μ2

bμ1

bμ1

bμ1

aμ1

aμ1

aμ1

2nd column: states of the systemwhere server busy in phase 2

1st column:States wheresystem in phase 1

Page 23: Erlang, Hyper-exponential, and Coxian distributions

23

M/C2/1: steady state equations Steady state equations

1st set of equations (1st column)

'

]'_[]'_[

]____[]_[

S

SStransitionSstateP

SofoutratetransitionSstateP

1,12,121,111,1

01222211111

00122111011

02201100

....).(

.

.

....).(

....).(

....

nnnn PPPbP

PPPbP

PPPbP

PPbP

Page 24: Erlang, Hyper-exponential, and Coxian distributions

24

Balance equations 2nd set of steady state equations (2nd column)

We are interested in finding Pn

Prob of having n customers in the system

that can be obtained based on Pn1,n2

2,11,12,2

12211222

02111122

011022

...).(

.

.

...).(

...).(

..).(

nnn PPaP

PPaP

PPaP

PaP

2,11,1

12112

02011

000

.

.

nnn PPP

PPP

PPP

PP

Page 25: Erlang, Hyper-exponential, and Coxian distributions

25

Generating functions

Let us define generating function g1 (z) involving all probabilities Pi1

Where i customers are in the queue and 1st phase is busy

generating function g2 (z) based on {P02, P12, P22,…} Where the server is busy in phase 2

generating function g(z) based on Pn

The probability of having n customers in the system

]__1Pr[...)1(.)( 110110

11 busystagestPPgPzzgi

ii

]__2Pr[...)1(.)( 120220

22 busystagendPPgPzzgi

ii

Page 26: Erlang, Hyper-exponential, and Coxian distributions

26

Expressions for the generating functions Using the 2 set of balance equations, we get

(1), (2), and (3) =>

02201100

21122

10002220111

11

....

)(..)(..)()(

)(...])([1.])([

1.

)()(

PPbP

zgzzgazg

zgzPPzgz

Pzgz

b

zg

(1)

(2)

(3)

22

11

0022121

221

211

12

12

;,

.1)(

))1(1()(

)(.)1(

.)(

where

Pbzz

zzg

zgz

azg

Page 27: Erlang, Hyper-exponential, and Coxian distributions

27

Finding P00

g1 (1) = P01 + P11 + P21 +…=prob stage 1 is busy This is equal to traffic intensity for stage 1 => ρ1

g (z) = f(g1 (z), g2 (z))

212100

002212121

111

1.1.1

.1

)1(

aaP

Pb

g

22121212

0022

2100

)(1

).1()(

)(.)(.)(

zzb

Pzbbzg

zgzzgzPzg

Page 28: Erlang, Hyper-exponential, and Coxian distributions

28

Pn : recursive scheme

The general expression of probability Pn

2

212

2

21211

2

21

2211

11

0

110

1

;1

;1

1

,

,...2,1),(

bS

bS

b

bT

ASASA

SA

A

where

nATAPP

nnn

nnn