Contents
1. InformalIntroduction2. PalmCalculus
3. OtherPalmCalculusFormulae4. ApplicationtoRWP5. OtherExamples6. PerfectSimulation
2
1. Event versus Time Averages
Considerasimulation,stateStAssumesimulationhasastationaryregime
ConsideranEventClock:timesTnatwhichsomespecificchangesofstateoccur
Ex:arrivalofjob;Ex.queuebecomesempty
Eventaveragestatistic
Timeaveragestatistic
3
Example: Gatekeeper; Average execution time
4
0 90 100 190 200 290 300
50001000
Real time t (ms)
job arrival
50001000
50001000
Execution time for a job that
arrives at t (ms)
Viewpoint 1: System Designer Viewpoint 2: Customer
Example: Gatekeeper; Average execution time
5
0 90 100 190 200 290 300
50001000
Real time t (ms)
job arrival
50001000
50001000
Execution time for a job that
arrives at t (ms)
Viewpoint 1: System Designer Viewpoint 2: Customer
Two processes, with execution times 5000 and 1000
5000 10002 3000
Inspector arrives at a random timered processor is used with proba
90100 5000
10100 1000
4600
Sampling Bias
Ws andWc aredifferentAmetric definition should mentionthesampling method (viewpoint)Different sampling methods may provide different values:this is thesampling bias
PalmCalculus is asetofformulasforrelating different viewpoints
Canoften be obtained bymeans oftheLargeTimeHeuristic
6
Large Time Heuristic Explainedon an Example
Wewant torelate andWe apply thelargetimeheuristic
1.Howdowe evaluate these metrics inasimulation?
7
Large Time Heuristic Explainedon an Example
Wewant torelate andWe apply thelargetimeheuristic
1. Howdowe evaluate these metrics inasimulation?1
…1
where indexofnext greenorred arrow at orafter1
8
Large Time Heuristic Explainedon an Example
2. Breakoneintegral into pieces that matchthe ’s:1
…1
1⋯
1⋯
1 ⋯
1⋯
10
Sn =90,10,90,10,90Xn =5000,1000,5000,1000,5000
Correlationis>0
Wc >Ws
Whendothetwoviewpointscoincide?
14
The Large Time Heuristic
Formally correctifsimulation is stationary
Itis arobust method,i.e.independent ofassumptions ondistributions(andonindependence)
15
Other «Clocks»
16
Flow 1 Flow 2
Flow 3
Distribution of flow sizesfor an arbitrary flowfor an arbitrary packet
17
Load Sensitive Routing of Long-Lived IP FlowsAnees Shaikh, Jennifer Rexford and Kang G. Shin
Proceedings of Sigcomm'99
ECDF, per flow viewpoint
ECDF, per packet viewpoint
Meanflowsize:perflowperpacket
18
Flow 1 Flow 2
Flow 3
Distribution of flow sizesfor an arbitrary flowfor an arbitrary packet
Large «Time» Heuristic
1. Howdowe evaluate these metrics inasimulation?
2. Putthepackets side byside,sorted byflow
19
Flow n=1 Flow n=2 Flow n=3
p=1 p=2 p=3 p=4 p=5 p=6 p=7 p=8 p=9
Large «Time» Heuristic
1. Howdowe evaluate these metrics inasimulation?perflow ∑
perpacket ∑where when packet belongs toflow
2. Putthepackets side byside,sorted byflow
20
Flow n=1 Flow n=2 Flow n=3
p=1 p=2 p=3 p=4 p=5 p=6 p=7 p=8 p=9
1⋯
1⋯
1
Large «Time» Heuristic
3. Compare
22
Flow n=1 Flow n=2 Flow n=3
p=1 p=2 p=3 p=4 p=5 p=6 p=7 p=8 p=9
1
1 1
1 1 1 1var
1var
Large «Time» Heuristic for PDFs of flow sizes
Putthepackets side byside,sorted byflow
1. Howdowe evaluate these metrics inasimulation?
23
Flow n=1 Flow n=2 Flow n=3
The km clock vs the standard clock
ℓ speedfortheℓ kilometer1
ℓℓ
meanof ℓ
∑ 1ℓℓ
harmonicmeanof ℓ meanof ℓ
26
27
2. Palm Calculus : Framework
Astationaryprocess(simulation)withstateSt.SomequantityXt measuredattimet.Assumethat
(St;Xt)isjointlystationary
I.e.,St isinastationaryregimeandXt dependsonthepast,presentandfuturestateofthesimulationinawaythatisinvariantbyshiftoftimeorigin.Examples
St =currentpositionofmobile,speed,andnextwaypointJointlystationarywithSt:Xt =currentspeedattimet;Xt =timetoberununtilnextwaypointNotjointlystationarywithSt:Xt =timeatwhichlastwaypointoccurred
Stationary Point Process
Considersomeselectedtransitions ofthesimulation,occurringattimesTn.
Example:Tn =timeofnth tripend
Tn isacalledastationarypointprocessassociatedtoStStationarybecauseSt isstationaryJointlystationarywithSt
Time0isthearbitrary pointintime
28
29
Palm ExpectationAssume:Xt,St arejointlystationary,Tn isastationarypointprocessassociatedwithStDefinition :thePalmExpectation is
Et(Xt)=E(Xt |aselectedtransitionoccurredattimet)
Bystationarity:
Et(Xt)=E0(X0)
Example:Tn =timeofnth tripend,Xt =instantspeedattimetEt(Xt)=E0(X0)=averagespeedobservedatawaypoint
30
E(Xt)=E(X0)expressesthetimeaverageviewpoint.Et(Xt)=E0(X0)expressestheeventaverageviewpoint.Exampleforrandomwaypoint:
Tn =timeofnth tripend,Xt =instantspeedattimetEt(Xt)=E0(X0)=averagespeedobservedattripendE(Xt)=E(X0)=averagespeedobservedatanarbitrarypointintime
Xn
Xn+1
31
Formal DefinitionIndiscretetime,wehaveanelementaryconditionalprobability
Incontinuoustime,thedefinitionisalittlemoresophisticated
usesRadonNikodymderivative– seelecturenotefordetailsAlsosee[BaccelliBremaud87]foraformaltreatment
Palmprobability isdefinedsimilarly
32
Ergodic InterpretationAssumesimulationisstationary+ergodic,i.e.samplepathaveragesconvergetoexpectations;thenwecanestimatetimeandeventaveragesby:
Intermsofprobabilities:
33
Intensity of a Stationary Point ProcessIntensity ofselectedtransitions: :=expectednumberoftransitionspertimeunit
34
Two Palm Calculus FormulaeIntensityFormula:
wherebyconventionT0 ≤ 0<T1
InversionFormula
Theproofs aresimpleindiscretetime– seelecturenotes
Joe’ sWaitingTime
var
meanwaitingtime var
37
0.5 mean time between busessystem’s viewpoint
penalty due to variability
Campbell’s Formula
Shotnoisemodel:customern addsaloadh(t‐Tn,Zn)whereZn issomeattributeandTn isarrivaltime
Example:TCPflow:L=λVwithL=bitspersecond,V=totalbitsperflowandλ=flowspersec
44
t
Total load
T1 T2 T3
Is the previous simulation stationary ?
Seemslikeasuperfluousquestion,howeverthereisadifferenceinviewpointbetweentheepochn andtime
LetSn bethelengthofthenth epochIfthereisastationaryregime,thenbytheinversionformula
sothemeanofSn mustbefinite
Thisisinfactsufficient(andnecessary)
47
49
Time Average Speed, Averaged over nindependent mobiles
BluelineisonesampleRedlineisestimateofE(V(t))
50
A Random waypoint model that has no stationary regime !
Assumethatattriptransitions,nodespeedissampleduniformlyon[vmin,vmax]Takevmin =0 andvmax >0
Meantripduration=(meantripdistance)
Meantripdurationisinfinite!
Wasoftenusedinpractice
Speeddecay:“consideredharmful”[YLN03]
max
0max
1 v
vdv
v
Closed Form AssumeastationaryregimeexistsandsimulationisrunlongenoughApplyinversionformula andobtaindistributionofinstantaneousspeedV(t)
54
Removing Transient MattersA. Inthemobilecase,thenodesaremoreoftentowardsthecenter,distancebetweennodesisshorter,performanceisbetterThecomparisonisflawed.Shoulduseforstaticcasethesamedistributionofnodelocationasrandomwaypoint.Istheresuchadistributiontocompareagainst ?
Random waypoint
Static
A(true)example:Compareimpactofmobilityonaprotocol:
Experimenterplacesnodesuniformlyforstaticcase,accordingtorandomwaypointformobilecaseFindsthatstaticisbetter
Q. Findthebug!
A Fair Comparison
Werevisitthecomparisonbysamplingthestaticcasefromthestationaryregimeoftherandomwaypoint
Random waypoint
Static, from uniform
Static, same node location as RWP
57
5. PASTAThereisanimportantcasewhereEventaverage=Timeaverage“PoissonArrivalsSeeTimeAverages”
Moreexactly,shouldbe:PoissonArrivalsindependentofsimulationstateSeeTimeAverages
6. Perfect Simulation
AnalternativetoremovingtransientsPossiblewheninversionformulaistractableExample:randomwaypoint
Sameappliestoalargeclassofmobilitymodels
60
61
Removing Transients May Take Long
Ifmodelisstableandinitialstateisdrawnfromdistributionotherthantime‐stationarydistribution
Thedistributionofnodestateconvergestothetime‐stationarydistribution
Naïve:so,let’ssimplytruncateaninitialsimulationduration
Theproblemisthatinitialtransiencecanlastverylong
Example[spacegraph]:nodespeed=1.25m/sboundingarea=1kmx1km
62
Perfect simulation is highly desirable (2)
Distributionofpath:
Time = 100s
Time = 50s
Time = 300s
Time = 500s
Time = 1000s
Time = 2000s
Solution: Perfect Simulation
Def:asimulationthatstartswithstationarydistributionUsuallydifficultexceptforspecificmodelsPossibleifweknowthestationarydistribution
Sample Prev and Next waypoints from their joint stationary distributionSample M uniformly on segment [Prev,Next]Sample speed V from stationary distribution
68
Perfect Simulation Algorithm
SampleaspeedV(t)fromthetimestationarydistributionHow?A:inversionofcdf
SamplePrev(t),Next(t)How?
SampleM(t)