working paper: new concept of importance in restart simulations
TRANSCRIPT
1
Working Paper NEW CONCEPT OF IMPORTANCE IN RESTART SIMULATIONS
Manuel Villén-Altamirano Eduardo Casilari Arcadio Reyes-Lecuona [email protected] [email protected] [email protected]
Universidad de Málaga Dpto. Ingeniería Electrónica, ETSI Telecomunicación
Campus de Teatinos s/n, 29071, Málaga, Spain
Abstract. RESTART is a widely applicable accelerated simulation technique that allows the evaluation of extremely low probabilities. In this method, a number of simulation retrials are performed when the process enters regions of the state space where the chance of occurrence of a rare event of interest is higher. In previous papers the importance of a state, which is a measure of the chance of occurrence of the rare event when the state occurs, was defined. The mentioned regions should be defined by means of the importance of the states but, due to the difficulty of knowing them, they are defined by means of another function of the states called the importance function. The choice by the user of an importance function which reflects the importance of the states is crucial for the effective application of RESTART. The problem of the previous definition of importance is that the importance of a state does not only depend on the state itself but also on the chosen importance function. It produces a loop between importance and importance function which can make more difficult to find an appropriate importance function. The paper presents a new concept of importance which does not depend on the chosen importance function. It avoids the above mentioned loop and can make easier to find an appropriate importance function. The paper also presents the application of this new concept of importance to an M/M/1 queue and the work progress of its application to a two-queue Jackson tandem network.
1. INTRODUCTION
The study of critical events that occur very infrequently is of interest in many areas. As crude
simulations require prohibitively long execution times for the accurate estimation of very low
probabilities, acceleration methods are necessary.
Importance sampling is a well-known technique in rare event simulation, see e.g., [1]. Another
known method is RESTART. In this method a more frequent occurrence of a formerly rare event
is achieved by performing a number of simulation retrials when the process enters regions of the
state space where the chance of occurrence of the rare event is higher. These regions, called
importance regions, are defined by comparing the value taken by a function Φ of the system
state, the importance function, with certain thresholds Ti.
As indicated in [2], a suitable choice of the importance function is crucial for achieving a
high efficiency in the application of RESTART. An importance function is appropriate and
leads to an effective application of RESTART when the chance of occurrence of the rare event
when a certain system state occurs is similar for all the system states xi for which ( ) ii Tx =Φ .
2
For this purpose, [2] defines the importance of a state xi for which ( ) ii Tx =Φ , */ ixAP , which is
a measure of the chance of occurrence of the rare event when xi occurs. An importance function
is appropriate if all the states xi for which ( ) ii Tx =Φ have similar importance. The values of
( )ixΦ should reflect the values of * / ixAP in the sense that if */ ixAP is greater than *
/ jxAP for two
given states xi and xj , Φ(xi) should also be greater than Φ(xj).
The problem of the definition of */ ixAP is that the importance of a state xi does not only
depend on the state itself but also on the chosen importance function. When we apply
RESTART we have to find an importance function ( )ixΦ such that the values of ( )ixΦ reflect
the values of */ ixAP but, in its turn, the values of */ ixAP depend on the values of ( )ixΦ . This loop
can make more difficult to find an appropriate importance function.
The paper will present a new concept of importance of a state xi, i.e., a new measure of the
chance of occurrence of the rare event when xi occurs. This new importance, called ixI , does
not depend on the chosen importance function. Thus it avoids the above described loop and
makes easier to find an appropriate importance function. As with the previous concept of
importance, an importance function ( )ixΦ is appropriate if all the states xi for which ( ) ii Tx =Φ
have similar importance ixI .
Section 2 of the paper makes a review of RESTART and of the presently defined importance
*/ ixAP , showing the problem of the above mentioned loop. Section 3 presents the new concept of
importance ixI and shows that it is also a good measure of the chance of occurrence of the rare
event. Section 4 applies this new concept of importance to an M/M/1 queue and Section 5
shows the work progress of its application to a two-queue tandem Jackson network. Finally
Section 6 states the conclusions and provides guidelines for future work.
2. REVIEW OF RESTART AND OF THE PREVIOUS CONCEPT OF IMPORTANCE
RESTART has been described in several papers, e.g., [2]. Nevertheless, it is briefly described
here to provide a self-contained paper.
Let Ω denote the state space of a process X(t) and A the rare set whose probability is to be
estimated. A nested sequence of sets of states Ci, 1 2 , , MC C C⊃ ⊃ ⊃K is defined, which
determines a partition of the state space Ω into the regions 1i iC C+− ; the higher the value of i,
the higher the importance of the region 1i iC C+− , i.e., the higher the chance of reaching the rare
3
set. These sets are defined by means of a function, : Φ Ω → ℜ , called the importance function.
Thresholds of Φ, Ti (1 ≤ i ≤ M), are defined so that each set Ci is associated with iTΦ ≥ .
Φ(t)
t (time)
L
T 3
T2
T1
B3
B2
B1
B3
B1
1
D2D2
D33
D1D1
D2
D3
A
1DD
D
Fig. 1: Simulation with RESTART
RESTART works as follows: a simulation path, called main trial, is performed in the same
way as if it were a crude simulation. Each time the main trial enters set C1, the entry state is
saved and 11 −R simulation retrials of level 1 are performed. Each retrial starts with the saved
state and finishes when the retrial exits set C1. When set C2 is reached in the main trial or in a
retrial of level 1, 2 1R − retrials of level 2 are performed, each one finishing when they leave set
C2, and so on. Note that the oversampling made in the region 1i iC C +− (CM if i = M) is given
by the accumulative number of retrials: 1
i
i jj
r R=
= ∏ .
Figure 1 illustrates a RESTART simulation with M = 3, R1 = R2 = 4, R3 = 3, in which the
chosen importance function Φ also defines set A as L≥Φ . Bold, thin, dashed and dotted lines
are used to distinguish the main trial and the retrials of level 1, 2 and 3, respectively.
Following [2], let us define events Bi and Di:
• Bi )1( Mi ≤≤ : event at which iT≥Φ having been iT<Φ at the previous event;
• Di )1( Mi ≤≤ : event at which iT<Φ having been iT≥Φ at the previous event.
Up to now the importance )1(*/ MiP
ixA ≤≤ has been defined as the expected number of rare
events occurred in a trial [Bi , Di ) (without counting upper thresholds retrials) when the system
state at iB is xi.
Let us call Xi to the random variable describing the state of the system at an event Bi (of the
main trial) randomly taken, and )1( Mii ≤≤Ω to the set of possible system states at an event Bi.
Thus )1(*/ MiP
iXA ≤≤ is also a random variable which takes the value*/ ixAP when Xi = xi .
4
The expected importance of an event Bi , ( )MiP iA ≤≤∗ 1/ , is given by:
[ ] )(/*
/*
/ ixAXAiA xdFPPEPi
ii ∫Ω∗==
where F(xi) is the distribution function of Xi. And the variance of the importance of an event Bi ,
( ) ( )MiPViXA ≤≤∗ 1/ , is given by:
( ) ( )[ ] 2*/
2*/
*/ )( iAXAXA PPEPV
ii−=
Let us define the probability AP Pr= of the rare set A as the probability of the system being
in a state of the set A at the instant of occurrence of certain events denoted reference events (an
example of a reference event is a packet arrival). Let us call rare event or event A to a reference
event at which the system is in a state of the set A. The estimator of the rare set probability P
used in RESTART is:
M
A
rN
NP=ˆ
where NA is the total number of events A that occur in the simulation (in the main trial or in any
retrial) and N the number of reference events simulated in the main trial.
Define as the random variable indicating the number of events A in the main trial and
( ) [ ]00AAA NENVK = . As proved in [2] (see formulas (4) and (5)), can be written as:
[ ]( )[ ]
−+= ∑=
0
0
1
)1()ˆ(
A
iAM
i i
i
M
A
NE
NEV
r
R
r
K
N
PPV
χ (1)
where ( )( )0
,...,,, 210 iNiiiii XXXN=χ , 0
iN being the random variable indicating the number of events
Bi occurred in the main trial of a simulation randomly taken and ),...,,(021 iN
iii XXX being the vector
of random variables describing the system states at those events Bi. According to formula (15)
of [2], | can be written as:
| = ⁄∗ + ⁄∗ (2)
where γI, of which an expression is provided in Section 5.3.1 of [2], is a measure of the
dependence of the importance of the system states Xi of the different events Bi occurring in the
main trial. If the random variables Xi were independent γi would be equal to 1. In most practical
applications, there may be some dependence between system states of close events Bi but this
dependence is negligible for distant events Bi. Thus γi is usually close to 1 or at least of the same
order of magnitude as 1.
5
From formulas (1) and (2) can be deduced that the smaller the variances ( )*/ iXAPV , the smaller
the variance of the estimator of the rare set probability and thus the higher the efficiency of the
RESTART application. It is crucial for an efficient application of RESTART the choice of an
importance function ( )xΦ such that all the states xi for which ( ) ii Tx =Φ have similar importance.
In this way ( )*/ iXAPV is small and is also small.
Note that, roughly speaking, the importance */ ixAP of a state xi is equal to the expected
number of events A occurred in a trial (without counting upper thresholds retrials) from the
instant at which the system state is xi until the next instant at which the system is in a state x
such that Φ < Φ . Thus the importance of a state xi does not only depend on the state
itself but also depends on the chosen importance function Φ. As was said in the Introduction,
when we apply RESTART we have to find an importance function ( )ixΦ such that the values of
( )ixΦ reflect the values of */ ixAP but, in its turn, the values of *
/ ixAP depend on the values of
( )ixΦ . This loop can make more difficult to find an appropriate importance function.
3. NEW CONCEPT OF IMPORTANCE
To avoid the above mentioned loop we propose a new definition of importance:
The importance xI of a state x is defined as the limit when Nr approaches infinite of the
expected number of rare events occurring (without counting the retrials) in the Nr reference
events following the occurrence of state x, minus (i.e., minus the expected number of rare
events occurring in the Nr reference events following a random state).
Although the definition of Ix is independent from the importance function and thus from the
thresholds Ti, we can define I i and ! for each threshold Ti as:
[ ] )( iXXi xdFIIEIi
ii ∫Ω==
( ) ( )[ ] 22 )( iXX IIEIVii
−=
As proved in the appendix, a good approximation of | is given by:
[ ]( ) ( ) ( ) [ ] ( ) iXiiiAiA iIVNENVPNEV βχ 002*
/0 | += (3)
where " , whose expression is given in formula (23), is a factor lower than 1 and usually close
to 1.
6
From formulas (1) and (3) can be deduced that, as occurred with ( )*/ iXAPV , the smaller the
variances !, the smaller the variance of the estimator of the rare event probability and thus
the higher the efficiency of the RESTART application. Thus we can say that, also with this new
definition of importance, an importance function ( )xΦ is appropriate if all the states xi for which
( ) ii Tx =Φ have similar importance.
The advantage of this new definition is that, as the values of Ix do not depend on the values
of ( )xΦ , the loop existing with the previous definition of importance does not exist with this
new one and, consequently, the choice of an appropriate importance function can be easier.
4. APPLICATION OF THE NEW IMPORTANCE TO AN M/M/1 QUEUE
Consider an M/M/1 queue, in which customers with Poisson arrival enter the queue. The mean
arrival rate is λ and the service time is exponentially distributed with mean service rate µ. The
load is # = $ %⁄ . The buffer space is assumed to be infinite. The system state is defined by (j),
where j is the number of customers at the queue. The rare set is defined as & ≥ (, i.e. as the
number of customers in the queue exceeding a predefined threshold L. The rare set probability is
= #). The reference event is defined as the arrival of a customer. Thus a rare event is a
customer arrival occurred when & ≥ (. (j does not include the arriving customer). Let I j denotes
the importance of the state (j).
The importances I j may be derived from a system of equations in which each equation relates
the importance of a state (j) to the importance of the states to which the system can move from
it, plus an additional equation of normalization. From the definition of importance, it is easy to
see that the importance I j can be written as:
!* = ∑ ,*,./*,. − /*,.1 + !.∀. (4)
where:
• Pj,k is the transition probability from state (j) to state (k);
• /*,. is the number of rare events occurring in the transition from state (j) to state (k).
/*,. = 1 if he transition is due to the arrival of a customer when & ≥ (, and /*,. = 0 in
the remainig cases;
• /*,.1 is the number of reference events occurring in the transition from state (j) to state
(k). /*,.1 = 1 if he transition is due to a customer arrival and /*,.1 = 0 if the transition is
due to an end of service.
Thus the following system of equations can be written:
7
PII −= 10 (5a)
( ) 1111 −≤≤+
+−+
= −+ LjIPII jjj µλµ
µλλ (5b)
( ) LjIPII jjj ≥+
++−+
= −+ 11 1µλ
µµλ
λ (5c)
∑∞
=
=0
0j
jj Iρ (5d)
Equation (5d) is the normalization equation. It takes into account that the weighted mean
value of the expected number of rare events from each of the system states, weighting with the
corresponding state probability 1 − ##*, is equal to the expected number of rare events from a
random state.
From the above system of equations the following expression of the importance I j is
obtained:
!5 =67879− ):;<=>?: if& = 0! + :>?:B 1 − #*1 + &1 − ##)?*if& ≤ (!) + :>?:;>?: & − (if& ≥ (
(6)
As could be expected, I j is a monotonically increasing function, being negative for low
values of j. Thus an appropriate importance function is Φ& = &. As the monotonicity and
increasing properties of I j were already known, we could have chosen the importance function
Φ& = & without need of deriving formula (6).
Nevertheless to derive formula (6) has been useful as a first step to gain insight on how is the
importance in queuing networks. For example, we can learn from formula (6) that, except for
low values of j, the growth of !* is approximately exponential when & ≤ ( (the ratio
!* !*?> ≈ 1 #⁄⁄ ), and linear when & > (, given that !* − !*?> = #1 − #) 1 − # ≈ # 1 − #⁄⁄ .
5. APPLICATION OF THE NEW IMPORTANCE TO A TWO-QUEUE TANDEM JACKSON NETWORK
Consider the two-queue tandem Jackson network shown in Figure 2. Customers with Poisson
arrival enter the first queue and, after being served, enter the second one. The mean arrival rate
is λ and the service time is exponentially distributed in each queue with mean service rates 1µ
and 2µ , respectively. The load at each queue is )2,1( == iii µλρ . The buffer space at each
8
queue is assumed to be infinite. The system state is defined by ( )ji , , where i and j are the
number of customers at the first and at the second queue respectively.
λ
Figure 2: Two-queue tandem Jackson network
The rare set is defined as & ≥ (, i.e. as the number of customers in the second queue
exceeding a predefined threshold L. The rare set probability is = #) . The reference event is
defined as the end of service of a customer in the first queue and its arrival at the second queue.
Thus a rare event is a customer arrival at the second queue occurred when & ≥ (. (j does not
include the arriving customer). Let ! ,* denotes the importance of the state (i, j). Following the
same reasoning as in Section 4, the following system of equations can be stated:
0,10,0 II = (7a)
( ) 11,11
10,1
10, ≥−
++
+= −+ iPIII iii µλ
µµλ
λ (7b)
11,02
2,1
2,0 ≥
++
+= − jIII jjj µλ
µµλ
λ (7c)
( )11
11,
21
21,1
21
1,1
21, −≤≤
≥++
+−++
+++
= −+−+ Lj
iIPIII jijijiji µµλ
µµµλ
µµµλ
λ
(7d)
( )Lj
iIPIII jijijiji ≥
≥++
++−++
+++
= −+−+
11 1,
21
21,1
21
1,1
21, µµλ
µµµλ
µµµλ
λ (7e)
∑∑∞
=
∞
==
0 0,21 0
i jji
ji Iρρ (7f)
Up to now, we have not been able to solve this system of equations. Any suggestion of the
audience on how to solve it will be very welcome.
However if we define !F,* as the mean weighted value of the importance of the states ( )ji ,
for a given value of j and any value of i, that is:
( ) jii
ijm II ,
011. 1 ∑
∞
=
−= ρρ
9
we have proved that !F,* satisfies the equations (5a) to (5d) of the M/M/1 queue (substituting I j
by Im,j , µ by µ2 and ρ by ρ2). Therefore Im,j may be obtained from formula (6) (making the same
substitutions).
6. CONCLUSIONS AND FUTURE WORK
We have presented a new concept of importance which avoids the loop between importance and
importance function existing with the previous concept, and thus can make easier to choose an
appropriate importance function.
With this new concept we have obtained formulas of the importance of each state in an
M/M/1 and we have stated the system of equations from which the formulas of the importance
of each state in a two-queue tandem network could be derived. However we have not been able
up to now of solving this system of equations.
First future work is obviously to solve the above mentioned system of equations for
obtaining formulas of the importance of the states of the two-queue tandem network. We ask the
audience any suggestion or cooperation for solving this system of equations. Once we have
solved this problem, we will try to obtain formulas of the importance of other simple Jackson
queuing networks such as the following ones:
- A network as that of Figure 2 where a fraction of the customers leaves the system after
being served in the first queue without entering the second queue;
- A network as that of Figure 2 where a fraction of the customers coming from outside the
network directly enter the second queue;
- A network with both features mentioned in the two previous cases;
- A network with two queues in the first stage and one queue in the second stage;
- A three-queue tandem network.
If we are able of solving all the above simple Jackson networks, we think that we will have
gained insight which allows making approximations for more complex Jackson queuing
networks and choosing appropriate importance functions, hopefully in a more accurate way than
using the existing formulas [3].
Once we have new formulas of the importance function in Jackson queuing networks, we
will apply the concept of effective load introduced in [4] to obtain formulas of the importance
function in non-Markovian queuing networks.
10
APPENDIX: DEVELOPMENT OF GHIJK|LM AS A FUNCTION OF GNOM Let us define l
iZ as the random variable indicating the number of events A in the trial [Bi, Di)
starting in the lth event Bi of the main trial, and P Q as ∑=
=0iN
lk
ki
li ZU
As 10iA UN = , [ ]( )iANEV χ|0
can be written as:
[ ]( ) [ ]( ) [ ]( )[ ] ∑∑∞
=
∞
=
+ ∆=−=11
10 |||l
ll
ilii
liiA UEVUEVNEV χχχ (8)
being:
[ ]( ) [ ]( )ilii
lil UEVUEV χχ || 1+−=∆
As P Q = R Q + P QS>, we can write l∆ as:
[ ]( )[ ] [ ] [ ][ ] [ ]( ) [ ]( )21212||2| ++ +−⋅+=∆ l
ilii
lii
lii
lil UEUEUEZEEZEE χχχ (9)
The first term of this expression of l∆ can be written as:
[ ]( )[ ] [ ]( )[ ] [ ]( )[ ]200202|Pr||Pr| l
iliiii
liii
li XZEElNlNZEElNZEE ≥=≥≥= χχ (10)
The condition lNi ≥0 also exit in the last member of (10), but it has not been indicated
because it is implicit in the condition liX . If liX exists, then lNi ≥0 .
Manipulating in the same manner the second term of l∆ , we have:
[ ] [ ][ ] [ ] [ ][ ]li
li
li
liii
lii
li XUEXZEElNUEZEE ||Pr|| 101 ++ ⋅≥=⋅ χχ (11)
Substituting (10) and (11) in (9) and after some mathematical manipulations, we obtain:
[ ]( ) [ ]( )( ) [ ]( ) [ ]( )( ) [ ]( ) [ ]( )212201200
10
||Pr
||Pr
++
+
+−≥−≥≥+
+−≥=∆
li
lii
lii
lii
li
li
li
liil
UEUElNUElNUElN
XUEVXUEVlN
(12)
Let us call:
[ ]( ) [ ]( ) ∑∞
=
+−≥=Ω1
101 ||Pr
l
li
li
li
lii XUEVXUEVlN (13)
[ ]( ) [ ]( ) [ ]( )2120120
1
02 ||Pr ii
lii
li
li UElNUElNUElN −≥−≥≥=Ω +
∞
=∑ (14)
From (12), (13) and (14) we obtain 211
Ω+Ω=∆∑∞
=ll and, taking into account (8), we have:
11
[ ]( ) 210 | Ω+Ω=iANEV χ (15)
As [ ] 0|00 1 =+ ii N
iNi XUE and thus [ ] 0|
00 1 =
+ ii N
iNi XUEV , we can write Ω1 as:
[ ]( ) [ ]( )
[ ]( ) [ ]( ) [ ]( ) ∑
∑∑∞
=
−
+∞
=
∞
=
−≥+≥=
=+≥−≥=Ω
2
10110
1
1
0
1
01
||Pr|1Pr
|1Pr|Pr
l
li
li
li
liiiii
li
li
li
li
li
li
XUEVXUEVlNXUEVN
XUEVlNXUEVlN
(16)
Taking into account that 1++= li
li
li UZU , [ ] *
/0| iAi
li PlNZE =≥ , [ ] [ ]0*
/1
iiAi NEPUE = and that
[ ] ∑∞
+=
+ ≥=≥≥1
0*/
010 Pr|Prlj
iiAilii jNPlNUElN , we can write Ωas:
( ) [ ]( ) ( ) ( )02*/
20
1 1
002*/2 Pr2Pr iiAi
l ljiiiA NVPNEjNlNP =
−
≥+≥=Ω ∑ ∑
∞
=
∞
+=
(17)
Substituting (16) and (17) in (15), we obtain:
[ ]( ) ( ) ( ) [ ]( )
[ ]( ) [ ]( )( )∑∞
=
−−≥+
+≥+=
2
10
11002*/
0
||Pr
|1Pr|
l
li
li
li
lii
iiiiiAiA
XUEVXUEVlN
XUEVNNVPNEV χ (18)
As an approximation, let us evaluate [ ]( )li
li XUEV | and [ ]( )1| −l
ili XUEV assuming that the
simulation has infinite length and thus: ∑∞
=
+=∞=1
0 ,j
jli
lii ZUN . Although R QS* depends on U Q
(or on U Q?>), this dependence is very small for high values of j. Thus to include in PQQ terms
R QS* with a high value of j has a small impact on [ ]( )li
li XUEV | and on [ ]( )1| −l
ili XUEV . As
the correlation between ...,,...,, 1 jli
li
li ZZZ ++ is positive in most applications, the
approximation will usually lead to a slight overestimate of [ ]( )li
li XUEV | and
[ ]( )1| −li
li XUEV and thus of [ ]( )iANEV χ|0 .
With this approximation, [ ]( )li
li XUEV | and [ ]( )1| −l
ili XUEV do not depend on the value
of l because they really depend on the value of − V, and if = ∞ the value of − V is
the same for any value of l. As [ ]∑∞
==≥
1
00Prl
ii NElN , formula (18) becomes:
[ ]( ) ( ) ( ) [ ]( )[ ] ( ) [ ]( ) [ ]( )( )100
002*/
0
||1Pr
|1Pr|
−−≥−+
+≥+=
li
li
li
liii
li
liiiiAiA
XUEVXUEVNNE
XUEVNNVPNEV χ (19)
12
If = ∞, the importance of the state Q, !XY, is equal to P Q| Q minus a term which does
not depend on Q . Thus:
[ ]( ) ( ) ( )il
iXX
li
li IVIVXUEV ==| (20)
In the same manner:
[ ]( ) [ ][ ]( ) [ ]
== −−− 111 |||| l
iX
li
li
li
li
li XIEVXXUEEVXUEV l
i (21)
Substituting (20) and (21) in (19) and taking into account that Z!Y[ − Z \!Y|U Q?>][ =
= \ Z!Y|U Q?>[] , we have:
[ ]( ) ( ) ( ) [ ] ( ) iXiiiAiA iIVNENVPNEV βχ 002*
/0 | +=
(22)
being:
" = Pr` ≥ 1a + b1 − Pr` ≥ 1a c Z!Y|U Q?>[! 23 As Z!Y|U Q?>[ is smaller than ! but usually close to !, factor " is smaller than 1
but usually close to 1.
REFERENCES
[1] Rubino, G., and Tuffin, B. (editors). 2009. Rare even simulation using Monte Carlo
methods. Chichester: Wiley.
[2] Villén-Altamirano, M., and Villén-Altamirano, J. 2002. Analysis of RESTART Simulation:
Theoretical Basis and Sensitivity Study. European Transaction on Telecommunications 13, 4,
373-385.
[3] Villén-Altamirano, J. 2010. Importance function for RESTART simulation of general Jackson
networks. Eur. J. Oper. Res. 203(1), 156-165.
[4] Villén-Altamirano, J., and Villén-Altamirano, M. 2013. Rare event simulation of non-
Markovian queuing networks using RESTART method. Simulation Modelling Practice and
Theory 37, 70–78.