Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in...

17
Variance Reduction Techniques Simulation

Transcript of Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in...

Page 1: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Variance Reduction Techniques

Simulation

Page 2: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

What is VRT?

Techniques that seek to reduce variance in the response of a simulation experiment by inducing correlations between sets of data. Two approaches are described• Common Random Numbers• Antithetic Variates

Page 3: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Common Random Numbers

• By inducing positive correlation between two sets of data we can reduce variance. This can be useful when comparing two systems to see if there is a difference in their means.

• also known as – ‘correlated sampling’ and as – ‘matched streams’ or – ‘matched pairs’

Page 4: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

How CRN works

In using CRN when one model generates a sample that is ‘high’ (in the extreme end of the distribution used) then the second model also samples a ‘high’ value; likewise when A samples ‘low’ B samples ‘low’. This induces positive correlation that reduces variance.

Page 5: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Simulation of CRN effect

Using Common Random Numbers

Page 6: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Difference between Zippy & Klunkywith and without use of CRN

Page 7: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

CRN vs. Paired-t• There’s no conflict• The use of CRNs reduces the variance in the

difference (Zi) compared with entirely independent results for A & B

without CRN with CRN

Z

Page 8: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

How this affects comparisons

Fig 11.4 (Law & Kelton)

Zj

-15 -10 -5 0 5 1015

INDEPENDENT

CRN

n=1

n=5

n=10

n=20

Page 9: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

FlexSim:Repeat Random StreamsIf deselected then every run will produce a different result because it won’t start from the same place in a stream.

If selected then each run will use the same sequence of samples.Equivalent to triggering this FlexScript for every stream used:

randinit(num stream, num seedvalue);

Page 10: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Initialising FlexSim streams

• Done automatically for streams 0 to 99 when FlexSim opens – not necessarily when you begin a run– unless you program this in an OnReset trigger

randinit(num stream, num seedvalue);

Examples:randinit(7,0); initialise stream 7 with its default seed

randinit(12,2302); initialise stream 12 with 2302 as seed

Beware: if you don’t specify a stream when you sample from a distribution then FlexSim will allocate stream 0.

Page 11: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Applying CRN in FlexSim

• Don’t let FlexSim allocate streams– i.e. don’t do this exponential(1.0);

• Use the same streams for the same behaviours in each model

• Initialise them with the same seeds– Recall, streams 0 to 99 are automatically initialised

• For example, if IAT is exponential with β=1.0– If system A’s IAT is specified as exponential(1.0,12);– Then so too should system B’s IAT

Page 12: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Antithetic Variates

• When attempting to estimate the mean value of some uncertain variable in a single system we can use Antithetic Variates (AV).

• In this case, rather than induce positive correlation, as in the case for CRNs, we seek to induce negative correlation.

• Over a number of independent replications we would expect the average of two results to be a better estimate than for a single result.

• S2 for an average over 2 runs using AV < S2 for an average over 2 runs not using AV

Page 13: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Antithetic Variates

• If a normal variate is specified as U[0,1] then the AV=1-U[0,1] --is its complement.

• Examples– Normal: 0.3, 0.4, 0.6, 0.9, 0.1– Antithetic: 0.7, 0.6, 0.4, 0.1, 0.9

Page 14: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Antithetic VariatesOutput from a Witness simulation model into Excel for analysis

Page 15: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Antithetic Variate procedure

The procedure when using AV is to:1. Make replication 1 using normal variates2. Repeat replication 1 using antithetic variates3. Calculate the average of the two runs 4. Repeat 1-3 as many times as time and the requirements of

your problem indicate5. If more than one replication has been made then calculate

the mean across all replications6. Calculate the approximate confidence interval

Page 16: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

FlexSim:randantithetic(num on/off)

Example: randantithetic(1);

Description: Makes number streams antithetic. Using this command, users can switch random streams to generate numbers between 1 and 0; rather than the default of 0 to 1. This is helpful for determining if random numbers are having a big affect on the results of the model. It's also useful when experimenting with massive models and there isn't sufficient time to run the model for multiple iterations as required for good statistical sampling. The user can then choose to do just one regular run and one antithetic run of the model to obtain two diametrically apposed results. These two results can be averaged for an approximation that is somewhat better than if each run of the model used random stream generators without antithetic sampling.

Page 17: Variance Reduction Techniques Simulation. What is VRT? Techniques that seek to reduce variance in the response of a simulation experiment by inducing.

Using the Script and Console Windows