Saturday, July 24, 2010

A different run (Part 4): Multi-threading and seed

This is the fourth and final part of a series of posts detailing the reasons of having different simulation output when rerunning Monte Carlo simulation models using CB. The other parts can be found here:
Part 1: CB Excel functions are not tied to seed
Part 2: Excel RAND() function in CB models - handle with care
Part 3: Running OptQuest with low-confidence testing at Extreme Speed

In this last post I will cover two other reasons for getting different results from simulation runs. The first one is non-obvious: we have seen that running optimization in multi-threaded Excel environment, like Excel 2007 can result in difference in the numbers from simulation to simulation. We use Excel engine for calculating the values of the forecasts in the spreadsheet model, and some dependencies in the model when coupled with multi-threaded Excel engine results in this issue. A good overview of the multi-threading option for Excel recalcs can be found here.

Workaround: If you notice this issue, check if you have multi-threaded calculations enabled. In Excel 2007, you can find this option at Office Button -> Excel Options -> Advanced -> Formulas -> 'Enable multi-threaded calculation'.

The last one is the obvious one. If you have come this far while debugging why you are getting different results from your spreadsheet each time you run your simulation or optimization model, do not forget to check if you have set the option of using the same sequence of random numbers in the CB 'Run Preferences' dialog. You will find it in the 'Sampling' tab in 'Run Preferences' dialog in CB. Note, you might have used VBA code to alter this option and then have forgotten to reset it.

Still not able to find out the reason? Contact us for support.

No comments:

Post a Comment