Tutorials › Econometrics (Graduate) › Optimizing Noisy Simulated Objectives

Simulation-Based Estimation · Tutorial 902 of 952

Optimizing Noisy Simulated Objectives

Build and verify simulated-objective optimizers that distinguish genuine improvement from artifacts of simulation noise.

Advanced 10 min read

What You'll Learn

  • Set up a simulated objective and distinguish its simulation approximation error from sampling uncertainty.
  • Choose parameter scaling, feasible starting values, and multiple initializations for difficult objective surfaces.
  • Use fixed draws and common random numbers to make comparisons during optimization more stable.
  • Diagnose convergence using gradients, parameter constraints, and stability across starts and draw sets.
  • Validate a candidate solution with additional draws and check whether its apparent advantage exceeds simulation noise.

Why Optimizing a Simulated Objective Requires Extra Checks

An optimizer can report convergence even when it has found a poor parameter value. This risk is particularly important when evaluating the objective requires simulation: numerical variation can make a trial parameter appear better or worse simply because it was evaluated with different random draws. The optimizer may then follow a noisy surface, stop too early, or settle at a solution that changes substantially when the draws change.

The goal is not merely to obtain a small objective value or a successful software termination code. A reliable analysis must make the optimization problem stable enough to solve, find plausible solutions from sensible starting values, and check that the selected solution is not an artifact of simulation noise. These are computational checks; they do not replace the statistical assumptions or inferential analysis for the estimator.

Definition: Let \(Q(\theta)\) be the target criterion to minimize over a feasible parameter set \(\Theta\). A simulated criterion \(Q_R(\theta)\) uses \(R\) simulation draws to approximate \(Q(\theta)\). With fresh random draws at every evaluation, the computed value can vary across evaluations of the same \(\theta\). With a fixed draw set, \(Q_R(\theta)\) is deterministic during optimization, although it remains an approximation to \(Q(\theta)\). For a simulated likelihood, \(Q_R\) is often the negative simulated log likelihood; a moment-based estimator may instead minimize a criterion built from simulated moments.

The practical procedures below presume that the parameter constraints have been stated, the simulation method defines a meaningful approximation to the target criterion, and the criterion is sufficiently smooth in the region where a gradient-based optimizer is used. Some simulated probabilities or likelihood contributions can be close to zero, creating unstable log values or derivatives; these numerical issues must be addressed rather than treated as ordinary convergence. Earlier material on smooth simulated likelihood and gradient computation is relevant when selecting the objective and its derivatives.

Prepare the Optimization Problem

Before running an optimizer, make the parameterization and scale workable. Parameters measured in very different units can produce poorly balanced steps: a change of \(0.01\) may be substantial for one parameter and negligible for another. Rescale parameters where appropriate, or use transformations that enforce known constraints. For example, optimizing an unconstrained \(\eta\) and setting \(\sigma=\exp(\eta)\) ensures \(\sigma>0\). A transformation changes the coordinates of the problem, so reported parameter estimates should be converted back to their original scale.

Choose starting values using substantive knowledge, simpler estimates where available, or a coarse evaluation of the objective over plausible parameter values. When the objective may have multiple local minima or maxima, use several dispersed feasible starts. Record the objective, parameter values, termination status, and gradient or other convergence diagnostic for each run. The best run is not automatically trustworthy, but agreement among independent starts is useful evidence that the optimizer is not merely sensitive to initialization.

During a main optimization run, a fixed simulation design is often preferable to drawing afresh at each function evaluation. It makes the approximate objective reproducible and prevents random draw changes from obscuring the effect of changing \(\theta\). Common random numbers use the same draws when evaluating competing parameter values. This can reduce the variance of objective differences when the values computed at those parameters are positively correlated. It is not guaranteed to help in every problem, so its effect should be checked.

Worked Example: A Stable One-Parameter Update

Suppose a hypothetical simulated negative log likelihood, evaluated with a fixed set of draws, is locally \(Q_R(\theta)=(\theta-1.8)^2+0.20\), with \(0\leq\theta\leq3\). Use a Newton update from the feasible initial value \(\theta_0=0.80\).

The derivative is \(Q_R'(\theta)=2(\theta-1.8)\), and the second derivative is \(Q_R''(\theta)=2\). The Newton update for minimizing a differentiable criterion with positive local curvature is \(\theta_1=\theta_0-Q_R'(\theta_0)/Q_R''(\theta_0)\). Substitution gives \(Q_R'(0.80)=2(0.80-1.8)=-2.0\), so \(\theta_1=0.80-(-2.0)/2=1.80\). This value is inside the stated constraint set.

At the updated value, \(Q_R(1.80)=(1.80-1.80)^2+0.20=0.20\), while \(Q_R(0.80)=(-1.00)^2+0.20=1.20\). The gradient is zero and the curvature is positive, so this particular quadratic has a minimum at \(1.80\). In an actual simulated problem, these calculations would establish only that the fixed-draw approximation has a minimum there; checks using other starts and additional draws would still be needed.

Control Simulation Variation During Comparisons

Optimization depends on comparing criteria at nearby parameter values. If each evaluation uses independent draws, the difference between two computed values contains simulation variation from both evaluations. Reusing draws can make the two values move together, leaving a less variable difference. The variance identity makes the condition precise.

$$ \operatorname{Var}\{Q_R(\theta_a)-Q_R(\theta_b)\} = \operatorname{Var}\{Q_R(\theta_a)\} + \operatorname{Var}\{Q_R(\theta_b)\} - 2\operatorname{Cov}\{Q_R(\theta_a),Q_R(\theta_b)\}. $$

A positive covariance reduces the variance of the difference relative to otherwise comparable evaluations with zero covariance. A negative covariance increases it. Thus common random numbers are a variance-control strategy, not a guarantee of improvement and not a way to remove simulation approximation error. The draw count and design should be chosen deliberately; the earlier material on choosing simulation draw counts and designs addresses that choice. In optimization, the additional practical requirement is to avoid changing the draw design unpredictably from one candidate evaluation to the next.

Worked Example: Is a Small Objective Improvement Credible?

Suppose two hypothetical candidate parameter values, \(\theta_a\) and \(\theta_b\), have estimated objective means \(12.4\) and \(12.1\) across repeated simulation evaluations. The estimated variance of each objective value is \(0.16\). With common draws, their estimated covariance is \(0.12\). Compare the uncertainty in the difference with the case of independent draws.

The estimated difference is \(12.4-12.1=0.30\), favoring \(\theta_b\) for minimization. With common draws, its estimated variance is \(0.16+0.16-2(0.12)=0.08\), giving a standard deviation of \(\sqrt{0.08}\approx0.283\). If the evaluations were independent, the covariance would be zero; the variance would be \(0.16+0.16=0.32\), and the standard deviation would be \(\sqrt{0.32}\approx0.566\).

In this hypothetical calculation, paired evaluations make the estimated difference less variable. Yet the difference \(0.30\) is only about \(0.30/0.283\approx1.06\) paired standard deviations. It is not strong evidence, by itself, that \(\theta_b\) truly gives a better target objective. The calculation illustrates why stable comparisons help, and why a small numerical improvement should not automatically be treated as a real one.

Check Convergence, Not Just Termination

A numerical optimizer's stopping rule typically concerns its current approximate problem: for example, whether a gradient is small, a step is small, or the objective has stopped changing appreciably. None of those checks alone establishes that the target criterion is optimized. A small step can occur because the algorithm is stuck, parameters are poorly scaled, or numerical derivatives are unreliable. A small gradient is informative only when the derivatives are accurate and the solution is not improperly constrained.

For an interior solution in a differentiable unconstrained problem, a necessary first-order condition for a local minimum is a zero gradient. For a constrained problem, the relevant condition must account for the boundary; a nonzero unconstrained gradient at a boundary does not by itself imply failure. Check that estimated parameters satisfy all constraints and that the optimizer's constraint handling is appropriate. Where practical, inspect the curvature or evaluate nearby feasible parameter values to ensure the reported point behaves like a minimum rather than a saddle point or maximum.

A useful workflow separates optimization from validation. First optimize using a fixed draw design. Then evaluate the candidate and nearby alternatives using a larger or independent draw set. An independent validation design can reveal whether a candidate was unusually favorable on the optimization draws. If the objective rankings or estimates change materially, increase the simulation precision or investigate the simulation method before treating the result as stable.

Worked Example: Checking Stability Across Draw Counts

A hypothetical model is optimized by minimizing negative simulated log likelihood per observation, measured in log-likelihood units per observation. With \(R=200\) fixed draws, the optimizer returns \(\hat\theta_{200}=0.742\) and objective \(1.263\). With \(R=800\), it returns \(\hat\theta_{800}=0.731\) and objective \(1.251\). On an independent validation design with \(R=4{,}000\), the objective is \(1.249\) at \(0.731\) and \(1.250\) at \(0.721\).

The parameter change between the two optimization runs is \(0.742-0.731=0.011\), and the objective at the returned estimate decreases by \(1.263-1.251=0.012\) log-likelihood units per observation. On the independent validation design, \(0.731\) has an objective advantage of only \(1.250-1.249=0.001\) over \(0.721\). The validation comparison therefore suggests that the broad location is stable, but the distinction between these nearby values is slight at the displayed precision; it does not justify claiming that the second value is decisively inferior.

Suppose a numerical gradient at \(0.731\) is estimated as \(0.008\), with simulation-related standard error \(0.012\). Its magnitude is \(0.008/0.012\approx0.67\) standard errors, so it is not large relative to the reported gradient uncertainty. This is a diagnostic, not a formal hypothesis test. Taken together, the stable parameter across draw counts, close validation objectives, and small gradient relative to its uncertainty are consistent with a numerically stable solution. The optimizer's termination code alone would not provide this evidence.

A Practical Optimization Sequence

The following sequence makes the decisions and checks explicit. It is intended for smooth simulated criteria where the fixed-draw objective can be evaluated reproducibly; alternative methods may be required for discontinuous criteria or particularly difficult constraints.

1
Specify the target and constraints.
State whether the criterion is to be minimized or maximized, define the feasible parameter set, and identify any transformations used to enforce constraints.
2
Choose starts and scales.
Use plausible feasible starting values, rescale badly mismatched parameters, and run multiple starts if local optima are plausible.
3
Hold the design fixed for the main run.
Use the selected draws consistently during the optimization so changes in the criterion mainly reflect parameter changes rather than fresh simulation randomness.
4
Inspect numerical and statistical diagnostics.
Check termination status, gradients, constraints, nearby objective values, and whether different starts give comparable solutions.
5
Validate with more or independent draws.
Re-evaluate the candidate and relevant alternatives. If the solution or ranking is sensitive to the draw set, report and address that instability rather than relying on the initial run.

For very expensive objectives, an alternative is to use fresh simulation draws at successive iterations and treat the resulting gradient as stochastic. A common projected stochastic-gradient update has the form \(\theta_{k+1}=\Pi_{\Theta}\{\theta_k-a_k\widehat g_k\}\), where \(\widehat g_k\) estimates the gradient, \(a_k>0\) is a step size, and \(\Pi_{\Theta}\) projects onto the feasible set. Under suitable regularity conditions, an unbiased gradient estimate with controlled variance, and step sizes satisfying \(\sum_k a_k=\infty\) and \(\sum_k a_k^2<\infty\), such procedures can converge toward stationary points. They do not generally guarantee a global optimum, and a noisy stopping rule still needs careful validation. For many econometric applications, fixed-draw optimization followed by independent validation is easier to diagnose and reproduce.

Common Pitfalls and Why the Checks Matter

  • Taking the software's success flag as proof of a solution. A successful termination means the software met its stopping rule; it does not show that the target criterion is optimized or that simulation noise is negligible. Inspect the gradient, constraints, starts, and validation results.
  • Changing random draws at every comparison without accounting for it. Fresh draws can create apparent improvements unrelated to parameter changes. Use a stable draw design during the main run or explicitly use and diagnose an appropriate stochastic optimization method.
  • Assuming common random numbers always reduce noise. Their benefit depends on covariance. Estimate or otherwise assess the variability of paired differences; the covariance term can increase rather than reduce variance.
  • Reporting excessive precision from one draw set. If the estimated parameter shifts under a larger or independent draw design, digits beyond that stability are not meaningful evidence of precision.
  • Confusing numerical stability with statistical certainty. A well-optimized simulated criterion does not, by itself, quantify sampling uncertainty or establish that a model is correctly specified.
Key takeaway: Reliable optimization of a simulated objective requires a controlled draw design during the search and an explicit check afterward. Use plausible multiple starts, inspect the actual convergence conditions, and test whether the candidate and its objective ranking remain stable under additional or independent simulation draws.

Check Your Understanding

Try these questions before reviewing the discussion above.

  1. Why is a fixed simulation draw set useful during gradient-based optimization, and what approximation error does it leave in place?
  2. Two objective estimates have equal variance. Under what condition can common random numbers reduce the variance of their difference?
  3. A constrained optimizer stops at a boundary with a nonzero unconstrained gradient. Why is that fact alone insufficient to declare failure?
  4. A candidate's objective is slightly better on its optimization draws but worse on an independent validation design. What should be investigated before choosing between the candidate and its alternative?
  5. Give two reasons why a successful optimizer termination code does not establish that the target criterion has been reliably optimized.
Clinical Biostats