Palm Calculus Made Easy - École Polytechnique Fédérale ...perfeval.epfl.ch/printMe/palm.pdf ·...

69
Palm Calculus Made Easy The Importance of the Viewpoint JY Le Boudec 1

Transcript of Palm Calculus Made Easy - École Polytechnique Fédérale ...perfeval.epfl.ch/printMe/palm.pdf ·...

Palm CalculusMade Easy

The Importance of the ViewpointJYLeBoudec

1

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

9

Large Time Heuristic Explainedon an Example

2. Breakoneintegral into pieces that matchthe ’s:1

…1

1⋯

1⋯

1 ⋯

1⋯

10

Large Time Heuristic Explainedon an Example

3. Compare1

11

Large Time Heuristic Explainedon an Example

3. Compare1

⋯1

cov , ̅ cov ,1

cov ,

12

This is Palm Calculus !

13

cov ,

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

21

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

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

24

Cyclist’s Paradox

Onaroundtriptour,there is moreuphillsthan downhills

25

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

35

3. Other Palm Calculus Formulae

36

Joe’ sWaitingTime

var

meanwaitingtime var

37

0.5 mean time between busessystem’s viewpoint

penalty due to variability

38

Feller’s Paradox

We encountered Feller’s Paradox Already

39

40

For a Poisson process, what is the mean length of an interval ?

Rate Conservation Law

41

42

43

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

Little’s Formula

45

t

Total load

T1 T2 T3

4. RWP and Freezing Simulations

ModulatorModel:

46

Is the previous simulation stationary ?

Seemslikeasuperfluousquestion,howeverthereisadifferenceinviewpointbetweentheepochn andtime

LetSn bethelengthofthenth epochIfthereisastationaryregime,thenbytheinversionformula

sothemeanofSn mustbefinite

Thisisinfactsufficient(andnecessary)

47

48

Application to RWP

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

What happens when the model does not have a stationary regime ?

Thesimulationbecomesold

Stationary Distribution of Speed(For model with stationary regime)

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

56

Isitpossibletohavethetimedistributionofspeeduniformlydistributedin[0;vmax]?

57

5. PASTAThereisanimportantcasewhereEventaverage=Timeaverage“PoissonArrivalsSeeTimeAverages”

Moreexactly,shouldbe:PoissonArrivalsindependentofsimulationstateSeeTimeAverages

58

59

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

Stationary Distrib of Prev and Next

65

Stationary Distribution of Location Is also Obtained By Inversion Formula

66

No Speed Decay

68

Perfect Simulation Algorithm

SampleaspeedV(t)fromthetimestationarydistributionHow?A:inversionofcdf

SamplePrev(t),Next(t)How?

SampleM(t)

ConclusionsAmetricshouldspecifythesamplingmethodDifferentsamplingmethodsmaygiveverydifferentvaluesPalmcalculuscontainsafewimportantformulas

Whichones?

Freezingsimulationsareapatterntobeawareof