Lawfare Academy

Business Analytics: Optimization and Simulation · Chapter 6 of 8

Validate Monte Carlo estimates and compare policies with common randomness

Return to the linked course unit →

DEVELOPED COURSE TEXT

Validate Monte Carlo estimates and compare policies with common randomness

Separate a stochastic model from its random-number implementation

Helix orders seasonal kits before demand is known. Demand D takes 60,100 or 140 units with probabilities.3,.4,.3. Selling price is 10, order cost 6 and salvage value 2 for each leftover unit. Lost sales have no additional penalty in the initial model. For an order q, profit is 10 min(q, D)+2 max(q-D,0)-6 q. The minimum and maximum represent physical sales and leftovers; neither demand above stock nor unused stock should be treated as a full-price sale.
The small distribution permits exact enumeration, which is useful for validating a simulation before relying on it in a larger model. Atq 80, profit outcomes are 160,320,320 and expected profit 272. Atq 100, outcomes are 80,400,400 and mean 304. Atq 120, outcomes are 0,320,480 and mean 272. A simulation approximates these expectations by drawing demand states and averaging the resulting profits. It does not discover the probabilities or validate the demand model.

Distinguish outcome variability from Monte Carlo error

For independent replications, the sample mean has estimated Monte Carlo standard error s/sqrt(n), where s is the sample standard deviation of simulated profit. This quantifies numerical sampling error conditional on the specified input distribution and model. It is not the standard deviation of a single future profit and does not include uncertainty about the probabilities, price, cost or model structure. Increasing replications reduces this numerical error but cannot repair a wrong demand distribution.
The supplied independent test simulation uses 5000 demand draws with seed 68102. At the selectedq 100, the mean profit is 304.896 and Monte Carlo SE about 2.068467. A large-sample approximate 95 percent interval for the model expectation is 304.896±1.96×2.068467, roughly[300.842,308.950]. The exact expectation 304 lies inside. This illustrates a conditional numerical check; it is not a business forecast interval promising that one season's profit will fall in that range.

Use paired scenarios to compare decisions

To compareq 100 againstq 80, use the same demand draw for both policies and average the per-draw profit difference. The exact difference is-80 in the low state and 80 in the other two states, so its mean is 32. Common random numbers exploit positive co-movement between policy outcomes to reduce the variance of their difference. They do not guarantee variance reduction in every model; the covariance structure matters.
In the 5000 test draws, the paired mean difference is 32.448 with SE 1.034234. Estimating each policy on unrelated draws would discard useful pairing and can produce a noisier comparison. For this exact distribution, the paired difference variance is 5376, whereas the sum of independent policy variances is 26880. The decision comparison is therefore much more precise for the same number of paired draws. Record the pairing and use the standard error of differences, not the two marginal SEs added together.

Create reproducible streams and honest evaluation

The analysis uses a separate training stream, seed 68101, with 1000 draws to selectq from integers 0 through 160. It then evaluates the selected policy on the independent 5000-draw test stream. This prevents reporting an optimized training mean as an unbiased performance estimate. The training sample selectsq 100 in this record. If many policies are searched, selection can exploit simulation noise even when each individual estimator is unbiased.
A fixed seed permits reproduction but is not itself evidence of convergence. Check exact special cases, increase replication counts or use independent batches, and inspect tail behavior relevant to the decision. If outputs are dependent across replications, the IID standard error is inappropriate. If the model includes rare catastrophic events, ordinary simulation may need many more draws or specialized methods. The advanced report states the input distribution, random stream, replication unit, estimator, uncertainty and policy-selection design explicitly enough to separate numerical reliability from substantive validity.

Worked records

Record 1

Demand 60/100/140 with probabilities.3/.4/.3; price 10, cost 6, salvage 2. Independent training 1000 draws(seed 68101)selects q 100; test 5000(seed 68102)evaluates it.
Exact profits:q 80=(160,320,320), q 100=(80,400,400), q 120=(0,320,480).

Develop the reasoning

Test mean atq 100=304.896, SE=2.0684674395091798. Pairedq 100-minus-q 80 mean=32.448, SE=1.0342337197545899. Exact mean difference 32 provides an independent benchmark. These SEs describe numerical uncertainty in the specified model expectation, not parameter uncertainty or a one-season predictive range.

Progressive practice — optional

1. Foundation

What is expected profit atq 100 by enumeration?

Compare the worked reasoning

.3×80+.4×400+.3×400=304.

Change the record

Low-demand probability rises to.5, middle.3, high.2.

Compare the changed-record reasoning

Expected profit becomes.5×80+.5×400=240. More simulation draws would converge to the changed 240, not restore 304.

2. Application

How does IID Monte Carlo SE change when replications quadruple?

Compare the worked reasoning

It halves if variance is unchanged because SE scales as 1/sqrt(n).

Change the record

The original SE is 2 atn 2500; newn 10000.

Compare the changed-record reasoning

New SE is approximately 1, conditional on the same independent output distribution.

3. Transfer

Why evaluate both policies on the same demand draws?

Compare the worked reasoning

The paired difference can have lower variance because common shocks cancel.

Change the record

Policy responses are negatively correlated instead.

Compare the changed-record reasoning

Pairing can increase difference variance because Var(A-B)=Var(A)+Var(B)-2 Cov(A, B). Compare the covariance or independent-batch precision before assuming a benefit.

Sources and scope