download

Section 7.5: Nonstationary Poisson Processes
➤
Arrival rate
➤
Unrealistic in most DES applications
) interarrivals
Arrival times generated using Exponential (
➤
Stationary Poisson Process:
is constant in time
Nonstationary Poisson Process (NSPP):
➤
More realistic than a constant rate
Arrival rate is
➤
, a function of time
Section 7.5: Nonstationary Poisson Processes
1
Algorithm 7.3.1: Stationary Poisson Process
➤
Generates a realization of a stationary Poisson process
);
➤
Constant event rate
,
,
,
;
return
= 0.0;
= 0;
< )
while (
=
+ Exponential(1 /
++;
Section 7.5: Nonstationary Poisson Processes
2
NSPP: An Incorrect Algorithm
➤
Naively modify parameter to Exponential in Alg 7.3.1
);
Section 7.5: Nonstationary Poisson Processes
after
;
only at previous event time
Ignores future evolution of
,
➤
Considers value of
➤
,
,
return
= 0.0;
= 0;
< )
while (
=
+ Exponential(1 /
++;
3
:
, interarrival time
tends to be too large
tends to be too small
,
,
If rate increases at
monotone on
too large
, interarrival time
If rate decreases at
too small
➤
will decrease too slowly
varies slowly with , may produce acceptable approximation
If
➤
will increase too slowly
➤
✦
if
if
✦
For rate function
➤
“Inertia Error”
Section 7.5: Nonstationary Poisson Processes
4
Example 7.5.1: Using the Incorrect Algorithm
Consider NSPP with piecewise-constant rate function
➤
Construct a CDH to provide an estimate
"$
"
!
$"
!
"
#
!
"
➤
2.5
λ(t) · · ·
λ̂(t) —
2.0
λ̂(t) 1.5
1.0
0.5
➤
t
0
15
35
50
Inertia error evident at step discontinuities
Section 7.5: Nonstationary Poisson Processes
5
Two Correct Approaches
Clever use of acceptance-rejection
➤
Works for a wide range of event rate functions
➤
Easy to implement
➤
Not synchronized — potentially inefficient
➤
Thinning Method:
Inversion Method:
➤
Not applicable to more complex
Section 7.5: Nonstationary Poisson Processes
Synchronized — computationally efficient
➤
6
Thinning Method
such that
Generate a stationary Poisson process with rate
➤
Thin (discard) some event times to make nonstationary
➤
A clever use of acceptance-rejection
➤
Efficiency depends on
!
Section 7.5: Nonstationary Poisson Processes
('
%
('
%
('
%
!
('
➤
%
&
Based on existence of upper bound
➤
being a tight bound
7
('
('
);
*
Section 7.5: Nonstationary Poisson Processes
,
,
,
return
+
*
%
('
+
%
*
*
*
)
= 0.0;
= 0;
< )
while (
=
;
do
=
+ Exponential(1 /
= Uniform(0,
);
while ( >
);
= ;
++;
!
given
Generates a NSPP with rate
%
&
➤
Algorithm 7.5.1: Thinning Method
;
8
Thinning Explained
When
When
➤
Key to thinning is the event rate correction in the do-while loop
➤
is low, more event times are thinned
is high, fewer event times are thinned
λmax
.................................
.......
............
......
.......
.
.
.
.
.
......
.
.
.
.
.
.
.
......
.
.
......
....
.
.
.
.
......
.
.
•
.
.
.
.
.
.
.
.
......
.
.
.
.
.
.
.
.
.
......
.
.
.
.
......
.......
.
.
.
.
.
.
.
.
.......
.
.
.
.
.
.
.
.
.
.
.
.
.
........
....................
λ(s)
λ(t)
0
is far from
Section 7.5: Nonstationary Poisson Processes
('
s
%
&
Efficiency suffers if
an
*
➤
t
9
#
('
Same piecewise-constant rate function with
%
➤
Example 7.5.2: Using the Thinning Method
2.5
λ(t) · · ·
λ̂(t) —
2.0
λ̂(t) 1.5
1.0
0.5
t
15
35
➤
No inertia error
➤
Increased complexity (here,
2.2 times longer)
Section 7.5: Nonstationary Poisson Processes
50
,
0
10
Relatively efficient if
➤
Easy to implement
➤
At least two calls to Random required per event
➤
is a tight upper bound to
➤
('
Clever use of acceptance-rejection
%
&
➤
Recap: Thinning Method
Synchronization is a problem because of potentially multiple passes
through the thinning loop
Section 7.5: Nonstationary Poisson Processes
11
Inversion Method
Based on inversion method for random variate generation
➤
Cumulative event rate function:
/
0
1
3
for all
analogous to cdf
Section 7.5: Nonstationary Poisson Processes
1
2
Hence an inverse function
is strictly monotone increasing
-
4
➤
Assume
-
➤
analogous to pdf,
➤
12
Represents the expected number of events in
0
*
*
!
-
.
➤
exists, analogous to idf
12
➤
Generates a NSPP with rate
Algorithm 7.5.2: Inversion Method
+
5
+
5
,
;
!
for
*
*
/
6
Section 7.5: Nonstationary Poisson Processes
-
is the inverse of
1
➤
-
.
,
,
return
-
+
5
5
+
= 0.0;
= 0.0;
= 0;
< )
while (
=
+ Exponential(1.0);
=
;
++;
13
7 +
+
Generate event times
with rate
for a stationary Poisson process
7 Section 7.5: Nonstationary Poisson Processes
7 +
correspond to a NSPP with rate
1
+
transforms the ’s into event times
➤
➤
-
Equivalent to generating random events in
➤
➤
+
Inversion Method Explained
14
Inversion Method Explained
...
.....................
..............
.
.
.
.
.
.
.
.
.
.
......
........
.......
.
.
.
.
.
...
......
.....
.
.
.
.
.
...
...
.
.
..
...
...
..
....
...
...
.
.
...
....
.
.
.
..
......
......
.
.
.
.
.
....
.......
.........
.
.
.
.
.
.
.
.
.
.
....
...............
.....................
u4
u3
Λ(t)
u2
u1
0
t
1
2
4
-
a3
1
2
is piecewise constant,
-
If
➤
Usefulness lies in how easily
➤
a2
a1
a4
can be evaluated
is piecewise linear
easy to evaluate
Section 7.5: Nonstationary Poisson Processes
15
By integrating
8
<
: 9
;
➤
:
$"
#
"
.
for :
+
"
"
+
+
+
+
!
"
"
#
>
+
=
!
"
#
"
-
+
!
"
By solving
+
➤
-
=
!
$"
#
!
"
"
-
!
"
Use same piecewise constant event rate function
➤
Example 7.5.3: Inversion for Piecewise Constant
Section 7.5: Nonstationary Poisson Processes
.
16
➤
8
<
: 9
;
Example 7.5.3: Inversion for Piecewise Constant
Results for the NSPP generated using inversion:
2.5
λ(t) · · ·
λ̂(t) —
2.0
λ̂(t) 1.5
1.0
0.5
t
0
15
35
➤
Again, no inertia error
➤
Computational complexity same as for incorrect algorithm
Section 7.5: Nonstationary Poisson Processes
50
17
Recap: Inversion Method
➤
Computationally efficient
➤
Efficacy determined by ability to evaluate
➤
If
1
-
Requires one call to Random per event — synchronized
➤
-
Based on inversion method for generating random variates
➤
cannot be inverted easily in closed form:
-
Section 7.5: Nonstationary Poisson Processes
('
%
&
can be found
1. Use thinning if appropriate
(see pp. 291–292)
2. Use numerical methods to invert
3. Use an approximation algorithm (see pp. 289–290)
18
NSPP Algorithms in Next-Event Simulation
But we generate event times by summing interarrivals
➤
Thinning and inversion are easily adapted
➤
E.g.: using inversion, at time the next arrival is
=
G
IJH
E
DEF
K
? provided
!
?
AC @
B
-
-
➤
Algorithms return event times
➤
Section 7.5: Nonstationary Poisson Processes
19
, the residual
G
IJH
Section 7.5: Nonstationary Poisson Processes
?
?
is used as an argument to
?
E
DEF
AC @
B
=
K
-
-
-
If multiple cycles represented by
amount
-
✦
If a single cycle of arrivals, discard the event
✦
?
What if
? ➤
NSPP Algorithms in Next-Event Simulation
in the next cycle
20
Likely that
➤
not realistic
will vary continuously with
Instead, examine
Smooth polynomial approximations are hard to justify (accurate
estimates of
are hard to obtain)
➤
➤
For most applications, piecewise-constant
➤
Piecewise-Constant Vs. Piecewise-Linear
as a piecewise-linear function (spline)
Section 7.5: Nonstationary Poisson Processes
21
8
<
: 9
;
L
for
O
M
=
knot pairs
Defined by
is a piecewise-linear function
M N
➤
Assume that
L
➤
Piecewise-Linear Time-Dependent
λ4
...........
....•
........
......
.......
.
.
.
.
.
........
.
.
.
.
........
2
3.........
5
........
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
•
•...............
.....•
.........
.......
.
.
.
.
.
.
.........
......
.
.........
.
.
.
.
.
.........
......
.
.
.
.........
.
.
.
0
1 ............
6
.........
.........
.
.
.
.
.
..•
.
.
...
•..............................•
λ
λ
λ(t)
λ
λ
λ
λ
0
t
1
1
1
Section 7.5: Nonstationary Poisson Processes
Q
and
t6
t5
M
t4
P 5
t3
Assumptions:
t2
➤
t1
t0
22
-
+
and
-
,
8
<
: 9
;
involve four steps:
M
M
M
*
O
L
M
M
slopes of the linear segments
L
1. Define the
Construction of
Algorithm 7.5.3: Piecewise-Linear
cumulative event rates
#
O
L
/
M
-
R .
S
=
L
2. Define the
#
O
L
M
M
M
M
#
M
M
=
=
-
-
which can be calculated recursively as
Section 7.5: Nonstationary Poisson Processes
23
8
<
: 9
;
Algorithm 7.5.3: Piecewise-Linear
M
is constant
-
If
*
M
#
M
M
M
M
*
=
=
-
is quadratic
-
-
T
If
*
If
*
M
M
*
=
*
is linear
then
then
M
then
T
M
then
M
If
M
3. For each subinterval:
is linear
Section 7.5: Nonstationary Poisson Processes
24
8
<
: 9
;
Algorithm 7.5.3: Piecewise-Linear
-
can be solved for
M
M
+
=
-
M
+
-
+
If
*
M
M
+
M
M
*
=
=
#
M
+
=
-
M
+
#
-
-
can be solved for
*
then
+
then
T
M
If
M
4. For each subinterval:
Section 7.5: Nonstationary Poisson Processes
25
8
<
1
2
-
\
Z W
^
^
]
Z W
^
_
^
]
R
^
]
Z W
R
]
^
Z W
^
]
*/
-
and
M
M
➤
*
;
^
Z U
a
,
b
i
i
,
i
h U
,
^
return
U
g
X
Z U
a
e
f
_
b_
d
c^
Y
]
R
Y
`
_
]
Z W
Z U
[
Y
X
VW
VU
= 0.0;
= 0.0;
= 0;
= 0;
while (
< )
=
+ Exponential(1.0);
while ((
<
) and ( < ))
++;
=
;
/*
++;
— which branch of
O
Alg 7.5.2 with additional index
➤
: 9
;
Algorithm 7.5.4: NSPP for Piecewise-Linear
can be generated once externally
Section 7.5: Nonstationary Poisson Processes
26