370 likes | 384 Views
Mat-2.170 Simulation spring 2005. Variance reduction techniques. Outline. Variance reduction Common random numbers Antithetic variates Control variates Indirect estimation Conditioning. Variance reduction. Analyzing large-scale simulations may require great amounts of computer time
E N D
Mat-2.170 Simulationspring 2005 Variance reduction techniques Mat-2.170 Simulation Variance reduction techniques
Outline • Variance reduction • Common random numbers • Antithetic variates • Control variates • Indirect estimation • Conditioning Mat-2.170 Simulation Variance reduction techniques
Variance reduction • Analyzing large-scale simulations may require great amounts of computer time • Variance reduction techniques aim at reaching more accurate results with fewer calculations • The aim is to reduce the variance of output random variables Mat-2.170 Simulation Variance reduction techniques
Common random numbers (CRN) • Correlated sampling, matched streams • Applied when comparing two or more alternative system configurations • Basic idea: use exactly similar experimental conditions for each configuration • Differences in results should arise exclusively from operational differences between the configurations Mat-2.170 Simulation Variance reduction techniques
Common random numbers • Case of two alternatives • Let X1j and X2j be observations of configurations 1 and 2 in jth independent replication • Define = 1- 2 = E(X1j)- E(X2j) • n independent replications for each configuration • Zj = X1j - X2j, for j=1, 2, …,n ; E(Zj) = and • For independent X1j and X2j Cov(X1j, X2j )=0 • For positively correlatedX1j and X2j Cov(X1j, X2j )>0 Mat-2.170 Simulation Variance reduction techniques
X1j X1j X2j X2j 1 1 0 0 Uk Uk Does it always work? • Alternative models should respond similarly to large or small values of random numbers • For particular Uk for particular purpose, compare • Should also be true for generated random variates • Inverse transform is recommended since it provides strongest possible positive correlation Mat-2.170 Simulation Variance reduction techniques
Synchronization • Using similar random numbers for each configuration is not enough • Same random numbers should be used for same purposes synchronization • For instance, think of inter-arrival times and processing delays for particular entities in a queuing model • A small or a large value imply different things with respect to congestion • Synchronization requires programming effort Mat-2.170 Simulation Variance reduction techniques
Synchronization • How to achieve synchronization • Dedicate different random number streams for each purpose, e.g. arrivals, process times etc. • Store random quantities in entity attributes Mat-2.170 Simulation Variance reduction techniques
Difficulties • Programming may require very detailed knowledge of model logic • Variance that is induced in results may complicate statistical analyses • The extent of variance reduction is generally not known beforehand Mat-2.170 Simulation Variance reduction techniques
Example • A queuing system (Law & Kelton) • One or two servers, arrival Expo(1), service Expo(0.9) • I: All independent runs • A: common random numbers for arrivals • S: common random numbers for service • Difference in average delay in queue • 100 pairs of runs Mat-2.170 Simulation Variance reduction techniques
Example • Inventory system (Law & Kelton) • Company uses stationary (s, S) -policy: If inventory<s, order S-Inventory • Demand Disc(1/6, 1, 1/3, 2, 1/3, 3, 1/6, 4) every Expo(0.1) months • Order cost of the form CF + CVX, where X the ordered amount • Order delay Unif(0.5, 1) months • Unsatisfied demand is backlogged • Holding and shortage costs, cH and cs per item per month Mat-2.170 Simulation Variance reduction techniques
Independent CRN Results • The average monthly cost of operation Mat-2.170 Simulation Variance reduction techniques
Independent replications • Correlation of average monthly costs for designs 1 and 2 • 100 pairs of runs Mat-2.170 Simulation Variance reduction techniques
Common random numbers • Correlation of average monthly costs for designs 1 and 2 • 100 pairs of runs Mat-2.170 Simulation Variance reduction techniques
Independent replications • Correlation between random variates • 100 pairs of runs Mat-2.170 Simulation Variance reduction techniques
Common random numbers • Correlation between random variates • 100 pairs of runs Mat-2.170 Simulation Variance reduction techniques
Difference in means • Confidence interval for difference in average monthly costs for designs 1 and 2 Mat-2.170 Simulation Variance reduction techniques
Antithetic variates • Variance reduction for a single system • Basic idea: induce negative correlation between pairs of runs • The simplest form is to use complementary random numbers • Complement of U is 1-U Mat-2.170 Simulation Variance reduction techniques
Antithetic variates • Rationale • Let Xj1 and Xj2be ith independent pair of observations from the simulation model • total of n pairs of replications (X11, X12), …, (Xn1, Xn2) • E(Xj1) = E(Xj2) = • Xj = (Xj1 + Xj2)/2 ; E(Xj) = and • For independent Xj1 and Xj2 Cov(Xj1, Xj2)=0 • For negatively correlatedXj1 and Xj2Cov(Xj1, Xj2)<0 Mat-2.170 Simulation Variance reduction techniques
Some properties • Basic idea similar to common random numbers • Same recommendations largely apply • Responses to random numbers for specific purposes should be monotonic • Inverse-transform method for generating random numbers of desired distribution • Synchronization • Success depends on model characteristics Mat-2.170 Simulation Variance reduction techniques
The inventory model • Confidence interval for average monthly cost with design 2 Mat-2.170 Simulation Variance reduction techniques
Independent replications • Correlation of average monthly costs for successive replications with design 2 • 100 pairs of runs Mat-2.170 Simulation Variance reduction techniques
Antithetic variates • Correlation of average monthly costs for successive replications with design 2 • 100 pairs of runs Mat-2.170 Simulation Variance reduction techniques
Control variates • Variance reduction for a single system • Basic idea: use the correlation between an output and another variable Mat-2.170 Simulation Variance reduction techniques
Control variates • Consider, for instance, a queuing model • Y, service times and X, waiting times • Assume we want to estimate E(X)= • Additionally, assume Y is random, correlated with X and we know E(Y)= v • For a specific simulation run, Y > v implies X > • We adjust the observed X according to observed Y • Y is called the control variate of X Mat-2.170 Simulation Variance reduction techniques
Control variates • Calculating the controlled estimator of • Adjustment of the estimate of is proportional to Y-v • Let a be a constant with the same sign as correlation between Y and X • A controlled estimator for is XC = X - a(Y-v) • XC is an unbiased estimator of Mat-2.170 Simulation Variance reduction techniques
Control variates • Variance reduction • The variance of XC is • Variance of XC is less than that of X if Mat-2.170 Simulation Variance reduction techniques
Choosing adjustment a Mat-2.170 Simulation Variance reduction techniques
Choosing adjustment a • In practice, the true variance of Y and the covariance of Y and X will hardly ever be known • These can simply be replaced with their estimators • Let X1,X2,...,Xn and Y1,Y2,...,Yn be observations from n independent replications • The controlled estimator for becomes Mat-2.170 Simulation Variance reduction techniques
Additional notes • Since the estimated adjustment depends on Y, the controlled estimate is generally biased • The method generalises to multiple control variates • Finding control variates • Input random variables • Simplify model assumptions to calculate expectation of an output variable Mat-2.170 Simulation Variance reduction techniques
Example • A single server queuing system (Law & Kelton) • Arrival Expo(1), service Expo(0.9) • Average delay in queue for first 100 customers • System is initially empty and idle • Actual value for the expected queuing delay =4.13 Mat-2.170 Simulation Variance reduction techniques
Control variates • 10 independent replications • Xthe average delay in queue • Ythe average service time Mat-2.170 Simulation Variance reduction techniques
Control variates • Repeating the experiment of 10 independent replications 100 times Mat-2.170 Simulation Variance reduction techniques
Indirect estimation • For steady-state measures • E.g. a single erver queuing system • w the average total time in service • d the average waiting time in queue • Si service times • We replace the estimator of service time by its known expectation and thus have an indirect estimate for w Mat-2.170 Simulation Variance reduction techniques
Indirect estimation • A single server queuing system • Arrival Expo(1), service Expo(0.6) • Replication/deletion method 10 replications Average total delay of 500 customers Warm-up 100 delays Mat-2.170 Simulation Variance reduction techniques
Conditioning • For a single system • Assume we want to estimate E(X)= • Assume there is random variable Z such that we can analytically calculate E(X | Z = z) • Now we have = E(X) = EZ[ E(X | Z) ] • E.g. for discrete case with probability mass function p(z) • Observations are made on E(X|Z) instead of X, i.e. we sample from distribution of Z Mat-2.170 Simulation Variance reduction techniques
References • Averill M. Law & W. David Kelton (2000) Simulation modeling and analysis Mat-2.170 Simulation Variance reduction techniques