Lecture03 Printed

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

BU204: Stochastic Processes with Applications

随机过程及应用
Lecture Three: Poisson Process

罗俊 )
Instructor : Jun LUO (罗
Department of Management Science
Antai College of Economics and Management
Shanghai Jiao Tong University

Textbook : Introduction to Probability Models


(by Sheldon M Ross; Elsevier, 2010)

Shanghai Jiao Tong University Stochastic Processes with Applications 1 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

The Exponential Distribution

The Exponential distribution with parameter λ (指数分布):


continuous with density

λe −λx , x ≥ 0

f (x) =
0, x <0

F (x) = 1 − e −λx for x ≥ 0


Expectation: E (X ) = 1/λ (λ known as rate)
λ
Moment generating function: φ(t) = λ−t for t < λ
Variance: Var (X ) = 1/λ2

Shanghai Jiao Tong University Stochastic Processes with Applications 2 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Memoryless Property

A random variable X is said to be memoryless if

P{X > s + t|X > t} = P{X > s}

or equivalent to P{X > s + t} = P{X > t}P{X > s}


Example 5.3: Consider a post office that is run by two clerks. Suppose
that when you enter the system, two other customers are being served
by the two clerks respectively. You will be served after one of them
finishes. If the amount time that a clerk spends with a customer is
exponentially distributed with mean 1/λ, what is the probability that,
of the three customers, you are the last to leave the post office?
The Exponential r.v. is the unique continuous r.v. possessing the
memoryless property. Why?

F̄ (s + t) = F̄ (s)F̄ (t) → F̄ (x) = e −λx

Shanghai Jiao Tong University Stochastic Processes with Applications 3 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Example 5.5 - A Simple Inventory Problem


A store must decide how much of a certain commodity to order so as to
meet next month’s demand, where the demand is assumed to have an
exponential distribution with rate λ. If the commodity costs the store c per
pound, and can be sold at a price of s > c per pound, how much should be
ordered so as to maximize the store’s expected profit? Assume the inventory
left over at the end of the month is worthless and that there is no penalty if
the store cannot meet all the demand.
Let X be the random demand and Q be the order quantity. The expected
profit
P = sE [min(X , Q)] − cQ = sE [X − (X − Q)+ ] − cQ
Since E [(X − Q)+ ] = E (X − Q|X > Q)P(X > Q) = 1/λ · e −λQ ,
s s
P = − e −λQ − cQ
λ λ
Maximizing P yields Q = 1/λlog (s/c).
How about all unsold inventory can be returned for r per pound and there is
a penalty cost of p per pound of unmet demand?
Shanghai Jiao Tong University Stochastic Processes with Applications 4 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Hazard (Failure) Rate Function

Failure rate (故障率) is the frequency with which an engineered


system or component fails, expressed for example in failures per hour.
Very useful in reliability testing.
The conditional probability density that a t-year-old item will fail

r (t) = lim P{X ∈ (t, t + dt)|X > t}


dt→0
P{X ∈ (t, t + dt)}
= lim
dt→0 P{X > t}
f (t)
=
1 − F (t)

Hazard rate function r (t) uniquely determines a distribution F (t).


(Why?)
The exponential distribution: constant hazard rate function r (t) = λ.
Shanghai Jiao Tong University Stochastic Processes with Applications 5 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Some Further Properties of The Exponential Distribution


Let X1 , X2 , . . . , Xn be independent exponential r.v.s with mean 1/λi .
if λi ≡ λ, then X1 + · · · + Xn has a gamma distribution with
parameters n and λ. (using moment generating function!)
If λi may be different, P{X1 < X2 } = λ1 /(λ1 + λ2 ).
Define X = min(X1 , X2 , . . . , Xn ), Q
then what is the CDF of X ?
n
P{min(X ,
P1n 2 X , . . . , Xn )} > x} = i=1 P{Xi > x} =
exp[−( i=1 λi )x] – exponential distribution with rate ni=1 λi
P

Important property: X = min Xi is independent from the rank


i
ordering of Xi , since
P{Xi1 < Xi2 < · · · < Xin | min Xi > t}
i
= P{Xi1 − t < Xi2 − t < · · · < Xin − t| min Xi > t}
i
= P{Xi1 < Xi2 < · · · < Xin }
Pn
P{Xj = min(X1 , X2 , . . . , Xn )} = P{Xj < mini6=j Xi } = λj / i=1 λi
Shanghai Jiao Tong University Stochastic Processes with Applications 6 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Example 5.8
Suppose you arrive at a post office having two clerks at a moment when
both are busy but there is no one else waiting in line. You will enter
service when either clerk becomes free. If service times for clerk i are
exponential with rate λi , i = 1, 2, find E [T ], where T is the amount of
time that you spend in the post office.
Denote Ri the remaining service time of the customer with clerk i,
i = 1, 2.
E [T ] = E [T |R1 < R2 ]P{R1 < R2 } + E [T |R2 ≥ R1 ]P{R2 ≥ R1 }
Denote S your service time, so
1 1
E [T |R1 < R2 ] = E [R1 + S|R1 < R2 ] = +
λ1 + λ2 λ1
3
So E [T ] = λ1 +λ2
or E [T ] = E [min(R1 , R2 ) + S] = E [min(R1 , R2 )] + E [S]
Shanghai Jiao Tong University Stochastic Processes with Applications 7 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Example 5.10: Queues

Suppose that customers are in line to receive service that is provided


sequentially by a server; whenever a service is completed, the next person
in line enters the service facility. However, each waiting customer will only
wait an exponentially distributed time with rate θ ; if its service has not
yet begun by this time then it will immediately depart the system. These
exponential times, one for each waiting customer, are independent. In
addition, the service times are independent exponential random variables
with rate µ. Suppose that someone is presently being served and consider
the person who is nth in line.
Find Pn , the probability that this customer is eventually served.
Find Wn , the conditional expected amount of time this person spends
waiting in line given that she is eventually served.

Shanghai Jiao Tong University Stochastic Processes with Applications 8 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Example 5.10: Queues


Consider {Di }, where D0 is the remaining service time of the person in
service now, Di (i = 1, . . . , n) is the departure time of the ith person in
line. They are exponentially distributed with µ and θ.
Pn = 0 if Dn = min0≤i≤n Di
Pn = Pn−1 otherwise.
So Pn = (n−1)θ+µ µ
nθ+µ Pn−1 = · · · = nθ+µ
Since the time until the nth person in line enters service is the
minimum of these n + 1 random variables plus the additional time
thereafter, which is
1
Wn = + Wn−1
nθ + µ
n
X 1
= ··· =
nθ + µ
i=1

Shanghai Jiao Tong University Stochastic Processes with Applications 9 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Stochastic Processes (随机过程)

1 A collection of random variable {X (t) : t ∈ T } is called a stochastic


process
T : index set, often represent time,
T = {0, 1, 2, . . . } discrete-time process
T = [a, b] continuous-time process
X (t): the state of the process at time t
State space (状态空间): the set of all possible values that X (t) can
take

Shanghai Jiao Tong University Stochastic Processes with Applications 10 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Counting Processes
A stochastic process {N(t), t ≥ 0} is said to be a counting process if
N(t) represents the total number of events that occurs by time t.
Example:
If we let N(t) be the number of persons who enter a particular store at
or prior to time t, then N(t) is a counting process where the event
refers to the person enters the store (If N(t) denotes the number of
persons in the store at time t, it is not a counting process. why?)
Number of child born before t
Properties:
N(t) ≥ 0, integer valued
For s < t, N(t) − N(s) is the number of events that occur in the
interval (s, t]
Independent increments (独立增量): Number of events that occur in
disjoint time intervals are independent.
How about the example of persons in the store and child born?
Stationary increments (平稳增量): the distribution of the number of
events in any interval of time depends only on the time length.
Shanghai Jiao Tong University Stochastic Processes with Applications 11 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Poisson Processes

Definition 1: Poisson process with rate λ if


1 N(0) = 0.
2 The process has independent increments.
3 The number of events in any interval of length t is Poisson distributed
with mean λt, i.e.,
(λt)n
P{N(t + s) − N(s) = n} = e −λt
n!
Condition (3) is hard to verify.
Definition 2: Conditions (1) and (2) are the same, and Condition (3)
is as follows,
3(a) P{N(t + h) − N(t) = 1} = λh + o(h) for any t ≥ 0,
3(b) P{N(t + h) − N(t) ≥ 2} = o(h) for any t ≥ 0,
where the function f (h) is o(h) if limh→0 f (h)/h = 0.
Theorem: Definition 1 and Definition 2 are equivalent.

Shanghai Jiao Tong University Stochastic Processes with Applications 12 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Interarrival and Waiting Time Distributions


Interarrival time: Tn the elapsed time between the (n − 1)st and the
nth events.
{Tn } (n = 1, 2, . . . ) are independent identically distributed exponential
random variables with mean 1/λ.
P{T1 > t} = P{N(t) = 0} = e −λt
P{T2 > t|T1 = s} = P{0 events in (s, s + t]|T1 = s} =
P{0 events in (s, s + t]} = e −λt
Waiting time
P until the nth event (Arrival time) Sn
n
Sn = i=1 Ti , so gamma distributed with parameters n and λ.
Theorem: Suppose {Tn , n ≥ 1} is i.i.d. exponential r.v.s with mean
1/λ. Define N(t) = max{n : Sn ≤ t} where S0 = 0. Then
{N(t), t ≥ 0} is a Poisson process.
Exercise: Proof it.
Example 5.13 Suppose that people immigrate into a territory at a
Poisson rate λ = 1 per day. (a) What is the expected time until the
tenth immigrant arrives? (b) What is the probability that the elapsed
time between the tenth and the eleventh arrival exceeds two days?
Shanghai Jiao Tong University Stochastic Processes with Applications 13 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Properties of Poisson Processes


Suppose that each time an event occurs it is classified as either a type I
eventElementary
394
with probability p or a type II event with probability 1 − p,
Queueing Theory
independently of all other events.
Let
The N 1 (t) and
reverse N2 (t)is denote
operation respectively
also possible. A singlethe number
Poisson of type
stream may be I and type II into
decomposed
multiple
events occurringPoisson
independent in [0,streams
t]. if the decomposition
!n is such that customers are directed into
substreams i, i = 1, 2, . . . , n, with probability pi and i=1 pi = 1, as illustrated in Figure 11.4.
Proposition 5.2 {N (t), t ≥ 0} and {N2 (t), t ≥ 0} are both Poisson
The proof of these results is 1left to the exercises, where some helpful hints are provided.
processes having respective rates pλ and (1 − p)λ. Furthermore, the two
processes are independent.
p1
λ p1
p2
λ p2

λ λ p3

pn
λ pn

n Poisson streams

Figure 11.4. Decomposition of Poisson streams.


Shanghai Jiao Tong University Stochastic Processes with Applications 14 / 33
erposition/Decomposition of Poisson Streams
Chapter 5: The Exponential Distribution and The Poisson Process

en two or more independent Poisson streams merge, the resulting stream is also a P
Properties of Poisson Processes
am. It follows then that multiple arrival processes to a single service center can be mer
stitute a single arrival process whose interarrival times are exponentially distributed, so l
Suppose
nterarrivals times of {Nthei (t), t ≥ 0}, arrival
individual i = 1,processes
2, . . . , n, are
areexponentially
independentdistributed
Poisson (althoug
processes with
y having different parameters), as rate λ , then, th
i illustrated in Figure 11.3. If the i stream, i = 1, 2, . . .
ameter λi , then the parameter for the{N(t), merged t ≥stream
0} (also called the pooled stre
n by Pn
where N(t) = i=1 Ni (t), is a Poisson
n
process with rate
#
n
λ= X λi .
λ =i=1 λi .
i=1

λ1
λ2
Pooled stream
λ3 λ

λn

Figure 11.3. Superposition of Poisson streams.


Shanghai Jiao Tong University Stochastic Processes with Applications 15 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Example 5.15
Suppose nonnegative offers to buy an item that you want to sell arrive according
to a Poisson process with rate λ. Assume that each offer is the value of a
continuous random variable having density function f (x). Once the offer is
presented to you, you must either accept it or reject it and wait for the next offer.
We suppose that you incur costs at a rate c per unit time until the item is sold,
and that your objective is to maximize your expected total return, where the total
return is equal to the amount received minus the total cost incurred. Suppose you
employ the policy of accepting the first offer that is greater than some specified
value y . (Such a type of policy, which we call a y -policy, can be shown to be
optimal.) What is the best value of y ?
The time until an offer is accepted is an exponential random variable with
rate λF̄ (y ).
E [R(y )] = E [accepted offer] − cE [time to accept] = E [X |X >
y ] − c/[λF̄ (y )]
R∞
Differentiation yields y (x − y )f (x)dx = λc
If E [X ] < c/λ, no solution, so accept any offer.
Shanghai Jiao Tong University Stochastic Processes with Applications 16 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Conditional Distribution of the Arrival Times

Q: A simple case, what is the distribution of S1 (or X1 ) given


N(t) = 1 intuitively? How to verify the answer rigorously?

P{X1 < s, N(t) = 1}


P{X1 < s|N(t) = 1} =
P{N(t) = 1}
P{1 event in [0, s), 0 events in [s, t]}
=
P{N(t) = 1}
λse −λs e −λ(t−s) s
= −λt
=
λte t
Q: A general case, what is the joint distribution of S1 , . . . , Sn given
N(t) = n intuitively?
Key Insight: Given that N(t) = n, it is convenient to consider the n
arrival times as unordered r.v.s. which are i.i.d. with uniform
distribution over (0, t).
Shanghai Jiao Tong University Stochastic Processes with Applications 17 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Conditional Distribution of the Arrival Times


Order statistics (顺序统计量)
Let Y1 , Y2 , . . . , Yn be n i.i.d. random variables
Y(1) , Y(2) , . . . , Y(n) are the order statistics corresponding to
Y1 , Y2 , . . . , Yn if Y(k) is the kth smallest value among Y1 , Y2 , . . . , Yn
(k = 1, 2, . . . , n).
Lemma: If Yi , i = 1, . . . , n, are i.i.d. with pdf f (·) , then the joint
density function of the order statistics Y(1) , Y(2) , . . . , Y(n) is
n
Y
f (y1 , y2 , . . . , yn ) = n! f (yi ), 0 < y1 < y2 < · · · < yn < t
i=1
In particular, if Yi , i = 1, . . . , n, are i.i.d. with a uniform distribution
(0, t), then the joint density function of the order statistics
Y(1) , Y(2) , . . . , Y(n) is
n!
f (y1 , y2 , . . . , yn ) =
tn

Shanghai Jiao Tong University Stochastic Processes with Applications 18 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Conditional Distribution of the Arrival Times


Theorem 5.2 Given N(t) = n, the n arrival times S1 , S2 , . . . , Sn have
the same distribution as the order statistics (顺序统计量)
corresponding to n independent random variables uniformly
distributed on the interval (0, t).
Proof: Let 0 < t1 < t2 < . . . < tn < t and hi be small enough such
that ti + hi < ti+1 . Then,
P(Si ∈ [ti , ti + hi ), i = 1, . . . , n|N(t) = n)
= P(exactly 1 event in [ti , ti + hi ), no events others|N(t) = n)
Qn −λhi ) · e −λ(t− ni=1 hi )
P n
i=1 (λhi e n! Y
= = n hi
e −λt (λt)n /n! t
i=1

Dividing both sides by ni=1 hi and letting all hi go to zero yields that
Q

n!
f (t1 , . . . , tn ) = .
tn
Shanghai Jiao Tong University Stochastic Processes with Applications 19 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Additional Propositions

Proposition 5.4 Given that Sn = t, the set S1 , . . . , Sn−1 has the


distribution of a set of n − 1 independent uniform (0, t) random
variables. (very similar to Theorem 5.2)

Proposition 5.3 Following Proposition 5.2, suppose that there are k


possible types of events and the probability that an event is classified
as a type i event, i =P1, . . . , k, depends on the time y the event
occurs Pi (y ), where ki=1 Pi (y ) = 1. If Ni (t) represents the number
of type i events occurring by time t (i = 1, . . . , k), then Ni (t) are
independent Poisson
Rt random variables having means
E [Ni (t)] = λ 0 Pi (s)ds.

Shanghai Jiao Tong University Stochastic Processes with Applications 20 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Example 5.20 - Tracking the Number of HIV Infections


Due to the incubation period (random with a known distribution G ), it is
difficult for public health officials to be certain of the number of members of
the population that are infected by HIV virus at any given time. Assume
that individuals contract the HIV virus in accordance with a Poisson process
with unknown rate λ.
Let N1 (t) denote the number of individuals who have shown symptoms of
the disease by time t and N2 (t) the number who are HIV positive but have
not yet shown any symptoms by time t.
Since an individual who contracts the virus at time s will have symptoms by
time t with probability G (t − s) and will not with probability Ḡ (t − s), it
follows from Proposition 5.3 that N1 (t) and N2 (t) are independent Poisson
random variables with respective means
Z t Z t Z t
E [N1 (t)] = λ G (t − s)ds = λ G (y )dy E [N2 (t)] = λ Ḡ (y )dy
0 0 0
Rt
n1 0 Ḡ (y )dy
Assume n1 at time t, n2 can be estimated as Rt
G (y )dy
.
0

Shanghai Jiao Tong University Stochastic Processes with Applications 21 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Generalizations of the Poisson Process

Nonhomogeneous Poisson Process (非齐次泊松过程) with intensity


function λ(t) if
1 N(0) = 0.
2 The process has independent increments.
3 P{N(t + h) − N(t) ≥ 2} = o(h)
4 P{N(t + h) − N(t) = 1} = λ(t)h + o(h)
Time sampling an ordinary Poisson process
1 {N(t), t ≥ 0}: a Poisson process with rate λ.
2 An event occurring at time t, independently of what has occurred prior
to t, counted with probability p(t)
3 Nc (t): the number of counted events by time t.
4 The counting process {Nc (t), t ≥ 0} is a non-homogeneous Poisson
process with intensity function λ(t) = λp(t).

Shanghai Jiao Tong University Stochastic Processes with Applications 22 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Generalizations of the Poisson Process

Continued on Proposition 5.3 Suppose that there are k possible


types of events and the probability that an event is classified as a type
i event,Pi = 1, . . . , k, depends on the time y the event occurs Pi (y ),
where ki=1 Pi (y ) = 1. If Ni (t) represents the number of type i
events occurring by time t (i = 1, . . . , k), then {Ni (t), t ≥ 0} are
independent nonhomogeneous Poisson processes with intensity
function λi (t) = λPi (t).
Let {N(t), t ≥ 0} and {M(t), t ≥ 0} be independent
nonhomogeneous Poisson processes, with respective intensity
functions λ(t) and µ(t). Let N ∗ (t) = N(t) + M(t). Then
1 {N ∗ (t), t ≥ 0} is a nonhomogeneous Poisson process with intensity
function λ(t) + µ(t)
2 Given that an event of the {N ∗ (t)} process occurs at time t then,
independent of what occurred prior to t, the event at t was from the
{N(t)} process with probability λ(t)/[λ(t) + µ(t)]

Shanghai Jiao Tong University Stochastic Processes with Applications 23 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Generalizations of the Poisson Process


Compound Poisson Process (复合泊松过程): A stochastic process
{X (t), t ≥ 0} is said to be a compound Poisson process if it can be
represented as
PN(t)
1 X (t) = i−1 Yi (t ≥ 0), where
2 {N(t), t ≥ 0} is a Poisson process, and {Yi , i ≥ 1} is a family of
independent and identically distributed r.v., also independent of
{N(t), t ≥ 0}.
Examples
1 If Yi ≡ 1, then X (t) = N(t): the usual Poisson process
2 Buses arrive at a sporting event in accordance with a Poisson process,
and that the numbers of fans in each bus are i.i.d. Then the number of
fans who have arrived by t, {X (t), t ≥ 0}, is a compound Poisson
process.
3 Customers leave a supermarket in accordance with a Poisson process.
If Yi , the amount spent by the ith customer (i = 1, 2, . . . ) are i.i.d.,
then {X (t), t ≥ 0} is a compound Poisson process where X (t) is the
total amount of money spent by time t.
Shanghai Jiao Tong University Stochastic Processes with Applications 24 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Generalizations of the Poisson Process

X (t) is a compound Poisson random variable with Poisson parameter


λt and Yi are identically distributed, then:
1 E [X (t)] = λtE [Y1 ]
2 Var [X (t)] = λtE [Y12 ]

Example 5.26: Suppose that families migrate to an area at a Poisson


rate λ = 2 per week. If the number of people in each family is
independent and takes on the values 1, 2, 3, 4 with respective
probabilities 1/6, 1/3, 1/3, 1/6, then what is the expected value and
variance of the number of individuals migrating to this area during a
fixed five-week period?

Shanghai Jiao Tong University Stochastic Processes with Applications 25 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Generating Poisson Processes


By Definition 3, we know that
If we know how to generate a sequence of i.i.d. exponential random
variables {Ti , i = 1, 2, . . .}
S0 = 0 and Sn = ni=1 Ti
P

N(t) = max{n : Sn ≤ t} is a Poisson process

Algorithm (I: Generating Poisson Process)


Step 0: Set the terminating time T and arrival rate λ.
Step 1: Set S0 = 0, and the index i = 0.
Step 2: Generate X ∼ exp(λ).
Step 3: Set Si+1 = Si + X .
If Si+1 > T , then stop and let N(t) = i for t ∈ [Si , T ], and return
{N(t), t ∈ [0, T ]} as a sample path.
Else if Si+1 ≤ T , then N(t) = i for t ∈ [Si , Si+1 ), and let i = i + 1, go
to Step 2.
Shanghai Jiao Tong University Stochastic Processes with Applications 26 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Generating Poisson Processes

Algorithm (II: Generating Poisson Process)


Step 0: Set the terminating time T and arrival rate λ.
Step 1: Generate n ∼ Poisson(λT ).
Step 2: If n = 0, then stop and return N(t) = 0 for t ∈ [0, T ].
Otherwise, generate n independent uniform random variables
Ui ∼ U(0, T ), and sort (in increasing order) to obtain U(i) .
Step 3: Let S0 = 0 and Si , i = 1, 2, . . . , n, denotes the ith smallest
value U(i) . Set N(t) = i for t ∈ [Si , Si+1 ), for i = 0, 1, . . . , n − 1, and
N(t) = n for t ∈ [Sn , T ]. Return {N(t), t ∈ [0, T ]} as a sample path.

Shanghai Jiao Tong University Stochastic Processes with Applications 27 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Inverse Transform for Continuous r.v.


The inverse-transform method:
Step 1. Generate a random number U (i.e., from Uniform[0, 1])
Step 2. Find X such that F (X ) = U and return this X
The technique is call inverse-transform because the step 2 can be
written as X = F −1 (U)

P(X ≤ a) = P(F −1 (U) ≤ a) = P(F (F −1 (U)) ≤ F (a)) = P(U ≤ F (a)) = F (a)


Shanghai Jiao Tong University Stochastic Processes with Applications 28 / 33
Chapter 5: The Exponential Distribution and The Poisson Process

Inverse Transform for Continuous r.v.

Exponential distribution

f (x) = λe −λx , x ≥0

Uniform[a, b] distribution

1
f (x) = , a≤x ≤b
b−a
Weibull distribution
β β−1 −(x/α)β
f (x) = x e
αβ

Shanghai Jiao Tong University Stochastic Processes with Applications 29 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Inverse Transform for Discrete r.v.


Discrete r.v. X
Takes values x1 , x2 , . . . , xn with probability mass function p(xi )
cdf F (x)
Inverse Transformation
Step 1. Generate a random number U
Step 2. Find the smallest xi such that U ≤ F (xi ) and return xi

Shanghai Jiao Tong University Stochastic Processes with Applications 30 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Inverse Transform for Discrete r.v.

Discrete uniform distribution


Takes values {1, 2, . . . , n} with probability mass function

1
p(x) = , x = 1, . . . , n
n
Exercise: Suppose the number of customers in each party to Canteen
2 has the following distribution. How to generate X ?
x p(x) F (x)
1 0.4
2 0.4
3 0.1
4 0.1

Shanghai Jiao Tong University Stochastic Processes with Applications 31 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

The Acceptance-Rejection Method

Suppose that we want to generate a r.v. X with pdf f (x), and


We know how to simulate a r.v. Y whose pdf is g (y ).
Let c be a constant such that f (y )/g (y ) ≤ c for all y .
The acceptance-rejection method:
Step 1. Simulate Y having density g and simulate a random number
U.
Step 2. If U ≤ f (Y )/cg (Y ), set X = Y . Otherwise return to step 1.
Example 11.5 To simulate a standard normal random variable Z N(0, 1).
Note that the absolute value of Z , denoted by X , has pdf
2
f (x) = √22π e −x /2 , x > 0. Let Y be an exponential r.v. with rate 1, i.e.,
2
g (x) = e −x , x > 0. Then, f (x)/g (x) = 2e/πe −(x−1) /2 ≤ 2e/π.
p p

Letting Z be equally like to be either X or −X .

Shanghai Jiao Tong University Stochastic Processes with Applications 32 / 33


Chapter 5: The Exponential Distribution and The Poisson Process

Generating Nonhomogenegous Poisson Processes

Algorithm (III: Generating Nonhomogenous Poisson Process)


Step 0: Set the terminating time T and intensity function λ(t) for
t ∈ [0, T ] and a constant arrival rate λ ≥ max λ(t).
t∈[0,T ]
Step 1: Set t = 0, S0 = 0, and the index i = 1.
Step 2: Generate u1 ∼ U(0, 1).
Step 3: Set t = t − λ1 log(u1 ). If t ≤ T , then,
Step 3(a): Generate u2 ∼ U(0, 1) independent of u1 . If u2 ≤ λ(t)/λ,
then set Si = t and i = i + 1.
Step 3(b): Go to Step 2.
Step 4. If t > T , Stop and set N(s) = j for s ∈ [Sj , Sj+1 ), for
j = 0, 1, . . . , i − 1, and N(s) = i for s ∈ [Si , T ]. Return
{N(s), s ∈ [0, T ]} as a sample path.

Shanghai Jiao Tong University Stochastic Processes with Applications 33 / 33

You might also like