Tutorials › Exam ASTAM - Advanced Short-Term Actuarial Mathematics › Simulation Budgets and Optimal Scenario Allocation

Exam ASTAM · Simulation Precision and Design · Tutorial 678 of 979

Simulation Budgets and Optimal Scenario Allocation

Derive and apply the cost-adjusted allocation that minimizes the variance of a weighted simulation estimate.

Intermediate 10 min read

What You'll Learn

  • Express the variance of a weighted estimate built from independent scenario sample means.
  • Derive the optimal continuous allocation when scenario run costs differ.
  • Calculate the minimum achievable variance under a fixed simulation budget.
  • Treat zero-weight and deterministic scenarios without imposing invalid zero-run allocations.
  • Distinguish continuous allocations from feasible integer-run plans.
  • Recognize why allocating runs without adjusting for cost can be inefficient.

Why Scenario Allocation Matters

A simulation study may estimate a target assembled from several scenarios. Some scenarios may have much more variable outputs than others, and a run in one scenario may take considerably longer than a run in another. Giving every scenario the same number of runs can therefore waste a fixed computational budget. The allocation problem is to choose the run counts that minimize the Monte Carlo variance of the weighted estimate, subject to the budget.

The result is useful when the target is a weighted combination of scenario means. It addresses simulation error under a specified model; it does not account for uncertainty in model parameters, and it does not decide which scenarios belong in the target.

Model and Variance of the Weighted Estimate

Definition: Let scenario \(j\) have output \(Z_j\), mean \(\mu_j=E[Z_j]\), variance \(\sigma_j^2=\operatorname{Var}(Z_j)\), and cost \(c_j>0\) per simulation run. The target is \(T=\sum_{j=1}^k w_j\mu_j\), where \(w_j\) is the weight for scenario \(j\). If \(n_j\) independent runs are made in scenario \(j\), let \(\bar Z_j\) be their sample mean and estimate \(T\) by \(\hat T=\sum_{j=1}^k w_j\bar Z_j\). If the simulation outputs are independent across runs and scenarios, then \(\operatorname{Var}(\hat T)=\sum_{j=1}^k w_j^2\sigma_j^2/n_j\). The run cost is \(\sum_{j=1}^k c_jn_j\).

The estimator is unbiased because \(E[\bar Z_j]=\mu_j\), so \(E[\hat T]=\sum_j w_j\mu_j=T\). Independence makes the variance of the weighted sum the sum of the weighted variances, and \(\operatorname{Var}(\bar Z_j)=\sigma_j^2/n_j\). These formulas require finite output variances. If outputs are dependent across scenarios, covariance terms must also be included, and the allocation result below does not apply as stated.

A scenario with \(w_j=0\) does not affect this target and can be omitted. For the continuous allocation result, consider only included scenarios with \(w_j\ne0\), \(\sigma_j>0\), and \(c_j>0\). Their run counts are treated as positive real numbers for the optimization, even though an actual simulation must use integer counts.

Deriving the Cost-Adjusted Allocation

Suppose the total budget is \(B\), so that \(\sum_j c_jn_j=B\). Define \(a_j=w_j^2\sigma_j^2\). The variance to minimize is \(\sum_j a_j/n_j\). Applying the Cauchy–Schwarz inequality to the two sequences \(\sqrt{a_j/n_j}\) and \(\sqrt{c_jn_j}\) gives

$$ \left(\sum_{j=1}^k \sqrt{a_jc_j}\right)^2 \leq \left(\sum_{j=1}^k \frac{a_j}{n_j}\right) \left(\sum_{j=1}^k c_jn_j\right). $$

Since the second factor on the right is \(B\), every feasible allocation has variance at least \((\sum_j\sqrt{a_jc_j})^2/B\). Equality in Cauchy–Schwarz holds when the two sequences are proportional, which requires \(n_j\) to be proportional to \(\sqrt{a_j/c_j}=|w_j|\sigma_j/\sqrt{c_j}\). Scaling those proportions to use the full budget gives the result.

Theorem: If the included scenarios have nonzero weights, positive standard deviations, and positive costs, the minimum-variance continuous allocation under budget \(B\) is $$ n_j = B\frac{|w_j|\sigma_j/\sqrt{c_j}} {\sum_{r=1}^k |w_r|\sigma_r\sqrt{c_r}}, \qquad \operatorname{Var}(\hat T)_{\min} = \frac{\left(\sum_{j=1}^k |w_j|\sigma_j\sqrt{c_j}\right)^2}{B}. $$

The absolute value appears because a negative weight still contributes a nonnegative variance term \(w_j^2\sigma_j^2/n_j\). The cost enters in two different ways: higher cost reduces the optimal run count through \(1/\sqrt{c_j}\), while it increases the contribution to the denominator and minimum variance through \(\sqrt{c_j}\). A scenario deserves more runs when its weighted standard deviation is large, but expensive runs temper that allocation.

Worked Example: Allocating Runs Between Two Scenarios

A hypothetical simulation estimates \(T=0.25\mu_1+0.75\mu_2\). Independent outputs have distributions \(Z_1\sim N(100,64)\) and \(Z_2\sim N(40,16)\), where the second parameter is the variance. A run costs \(c_1=\$1\) in scenario 1 and \(c_2=\$4\) in scenario 2. The budget is \(\$80\). Find the continuous optimal allocation and its variance. Name the method and identify the cost-related mistake it avoids.

Method. Apply the cost-adjusted allocation. The standard deviations are \(\sigma_1=8\) and \(\sigma_2=4\). The denominator is \(0.25(8)\sqrt{1}+0.75(4)\sqrt{4}=2+6=8\).

For scenario 1, the allocation numerator is \(0.25(8)/\sqrt{1}=2\), so \(n_1=80(2)/8=20\). For scenario 2, it is \(0.75(4)/\sqrt{4}=1.5\), so \(n_2=80(1.5)/8=15\).

The budget check is \(20(\$1)+15(\$4)=\$20+\$60=\$80\). The estimator variance is \(0.25^2(64)/20+0.75^2(16)/15=4/20+9/15=0.20+0.60=0.80\). The minimum-variance formula gives \(8^2/80=0.80\), an independent check. The optimal continuous counts happen to be integers here. This method avoids treating a run costing four times as much as an ordinary run as though it were equally expensive.

Worked Example: Three Scenarios With Different Costs

For a hypothetical weighted estimate \(T=0.5\mu_1+0.3\mu_2+0.2\mu_3\), let independent outputs have distributions \(Z_1\sim N(10,36)\), \(Z_2\sim N(20,100)\), and \(Z_3\sim N(5,25)\). The costs per run are \(c_1=\$1\), \(c_2=\$4\), and \(c_3=\$1\), and the budget is \(\$100\). Find the continuous allocation and verify its variance.

The standard deviations are \(6,10,5\). The denominator in the allocation formula is \(0.5(6)\sqrt{1}+0.3(10)\sqrt{4}+0.2(5)\sqrt{1}=3+6+1=10\). The allocation numerators, which use division by the square root of cost, are \(3\), \(0.3(10)/2=1.5\), and \(1\).

Thus \(n_1=100(3)/10=30\), \(n_2=100(1.5)/10=15\), and \(n_3=100(1)/10=10\). The cost is \(30(\$1)+15(\$4)+10(\$1)=\$30+\$60+\$10=\$100\).

The variance is \(0.5^2(36)/30+0.3^2(100)/15+0.2^2(25)/10=9/30+9/15+1/10=0.30+0.60+0.10=1.00\). The minimum-variance formula confirms this: \(10^2/100=1.00\). In particular, scenario 2 gets half as many runs as scenario 1, even though its weighted standard deviation is half as large before allowing for its higher cost.

Deterministic Scenarios and Required Minimum Runs

The theorem assumes positive \(\sigma_j\) for every included scenario. A deterministic scenario with \(\sigma_j=0\) has no simulation variance contribution, but a nonzero weight does not automatically mean the scenario can be assigned zero runs. If its constant output is unknown and a simulation run is needed to reveal it, at least one run is needed to define its sample mean. If the value is already known, it can instead be inserted directly into the estimate. These are different information assumptions.

When a deterministic scenario requires a run, reserve its minimum cost first. Apply the allocation formula to the positive-variance scenarios using the remaining budget. More generally, if scenarios have required minimum run counts, those constraints must be included in the optimization; the unconstrained formula may violate them. With zero-variance scenarios and mandatory positive counts, the equality case in the Cauchy–Schwarz derivation cannot assign them zero runs, so the unconstrained theorem does not describe that constrained optimum.

Worked Example: Reserving a Run for a Deterministic Scenario

A hypothetical target is \(T=0.4\mu_1+0.4\mu_2+0.2\mu_3\). Independent outputs have distributions \(Z_1\sim N(20,25)\), \(Z_2\sim N(30,100)\), and \(Z_3=7\) with certainty. The cost per run is \(\$1\) for each of scenarios 1 and 2 and \(\$2\) for scenario 3. The constant value 7 is not known in advance, so one run of scenario 3 is required to reveal it. With a \(\$20\) budget, find the allocation and the variance of the estimate.

One run in scenario 3 costs \(\$2\). Its output is then known exactly, so its contribution to Monte Carlo variance is zero. The remaining budget for scenarios 1 and 2 is \(\$20-\$2=\$18\). Their standard deviations are 5 and 10, and their allocation denominator is \(0.4(5)+0.4(10)=2+4=6\).

The optimal counts are \(n_1=18(2)/6=6\) and \(n_2=18(4)/6=12\). With \(n_3=1\), the total cost is \(6(\$1)+12(\$1)+1(\$2)=\$20\). The variance is \(0.4^2(25)/6+0.4^2(100)/12+0=4/6+16/12=2\). The minimum-variance check for the two random scenarios is \(6^2/18=2\). This calculation avoids the mistake of assigning zero runs to an unknown deterministic output merely because its variance is zero.

Integer Run Counts and Common Traps

The formula gives a continuous optimum. Simulation run counts must be positive integers, so rounding each count independently can exceed the budget or leave money unused. A practical plan rounds to feasible counts, checks the cost, and compares nearby integer allocations using \(\sum_j w_j^2\sigma_j^2/n_j\). If the budget is a strict maximum, the selected counts must satisfy \(\sum_j c_jn_j\leq B\); a leftover amount is acceptable if no affordable run can improve the variance.

A frequent error is to allocate runs in proportion to \(|w_j|\sigma_j/c_j\), dividing by cost rather than by its square root. In the first worked example this would give proportions \(2:0.75\), and the budget-constrained counts would be \(n_1=32\), \(n_2=12\): their cost is \(32+4(12)=80\). The resulting variance is \(4/32+9/12=0.875\), which is larger than \(0.80\). The correct allocation uses \(|w_j|\sigma_j/\sqrt{c_j}\), giving \(20\) and \(15\) runs and the lower variance \(0.80\).

Also distinguish a scenario’s contribution to variance from whether it must be simulated. A zero weight permits omission from this target. A zero variance removes Monte Carlo variance, but if the mean is unknown and must be obtained from simulation, a positive run count is still needed. The required minimum-run cost should be handled before optimizing the remaining allocation.

Key takeaway: For independent scenario sample means, allocate runs in proportion to weighted standard deviation divided by the square root of per-run cost. The minimum variance is the square of the sum of weighted standard deviations times square-root costs, divided by the budget, provided the theorem’s positive-variance assumptions apply.

Check Your Understanding

For each problem, determine the requested allocation or variance and check the budget and any stated minimum-run condition.

  1. A hypothetical target is \(0.6\mu_1+0.4\mu_2\). Independent output standard deviations are 5 and 8, costs are \(\$1\) and \(\$4\) per run, and the budget is \(\$100\). Find the continuous optimal counts and minimum variance. (Answer: \(n_1\approx31.91,\ n_2\approx17.02\); minimum variance \(=0.8836\); budget \(=\$100\).)
  2. A target is \(0.7\mu_1+0.3\mu_2\), with independent output standard deviations 4 and 6 and run costs \(\$1\) and \(\$1\). Scenario 2’s output is deterministic and its value is already known. Which scenario may be omitted, and which must still be simulated for this target? (Answer: Scenario 2 may be omitted because its known weighted contribution can be inserted directly; simulate scenario 1, whose weight and variance are nonzero.)
  3. A hypothetical target is \(0.2\mu_1+0.5\mu_2+0.3\mu_3\). Independent output standard deviations are 10, 4, and 6; run costs are \(\$1,\$1,\$4\); and the budget is \(\$120\). Find the continuous counts and minimum variance. (Answer: \(n_1\approx31.58,\ n_2\approx31.58,\ n_3\approx14.21\); minimum variance \(\approx0.4813\); total cost \(=\$120\).)
  4. A hypothetical estimate has two equally weighted independent scenario means, standard deviations 4 and 10, and run costs \(\$1\) and \(\$4\). With a \(\$50\) budget and integer counts, compare allocations \((n_1,n_2)=(10,10)\) and \((6,11)\) using their variances. Which is better? (Answer: \((10,10)\) costs \(\$50\) and has variance \(0.25(16)/10+0.25(100)/10=2.90\); \((6,11)\) costs \(\$50\) and has variance \(4/6+25/11\approx2.9394\), so \((10,10)\) is better.)
  5. A hypothetical target is \(0.3\mu_1+0.5\mu_2+0.2\mu_3\). Scenarios 1 and 2 have independent output standard deviations 4 and 8 and costs \(\$1\) and \(\$4\); scenario 3 is deterministic, costs \(\$2\) per run, and needs one run because its value is unknown. With budget \(\$50\), allocate the remaining budget continuously between scenarios 1 and 2 and calculate the resulting variance. (Answer: Reserve \(\$2\), leaving \(\$48\); \(n_1\approx6.26,\ n_2\approx10.43,\ n_3=1\); total cost \(=\$50\); variance \(=9.2^2/48\approx1.7633\).)
Clinical Biostats