Why the Analysis Pipeline Must Be Simulated
A simulated dataset does not produce a performance result by itself. The result depends on what happens after the data are generated: which model is fitted, what objective is optimized, how the optimizer is initialized, and how parameter constraints are applied. If the eventual study will be analyzed with a particular estimation procedure, a design simulation should reproduce that procedure rather than substitute an easier one.
The data-generating model and the estimation model have different roles. The data-generating model specifies how a replicate is produced under a chosen scenario. The estimation model and fitting procedure specify how the analyst would use the resulting observations. They may be identical when assessing a correctly specified analysis, or intentionally differ when evaluating a prespecified alternative analysis. In either case, the fitting procedure must be fixed before examining simulation results.
For replicate \(r\), denote the simulated dataset by \(Y_r\). The pipeline applies a fixed fitting rule to \(Y_r\) and returns an outcome, which may include parameter estimates, an objective value, and a status. In this way the simulation evaluates not merely an abstract estimator, but the estimator as it would actually be used.
Specify the Fit Before Generating Replicates
A useful specification answers several questions in advance. What likelihood or other objective will be optimized? Which parameters are estimated, and which are fixed? What parameterization is used? What are the permitted parameter ranges? What starting values will be supplied, and will there be one start or a fixed set of starts? What numerical conditions count as a completed fit? Finally, which fields will be retained whether the fit succeeds or not?
These choices matter in nonlinear models because the objective can have difficult geometry, and the optimizer may depend on its starting values. Bounds can also change the estimator: if an unconstrained optimum is outside a permitted range, the constrained estimate is obtained by optimizing only over that range. Starting values are computational inputs, not estimates of the unknown parameters. They should be selected using an explicit rule, not chosen separately after looking at each replicate’s simulated outcomes.
Initialization must not leak the generating truth into the analysis. For example, if a simulated replicate was generated using a clearance of 3 L/h, initializing the fit at 3 L/h solely because that value generated the replicate would give the fitting procedure information unavailable in the intended study. A valid prespecified rule might use fixed typical values, a simple data-based initialization that would also be available in practice, or a fixed set of starts. The rule should be applied consistently across replicates and designs.
Objective Functions, Bounds, and Outcomes
For a likelihood-based fit, an optimizer commonly minimizes the negative log-likelihood or \(-2\) times the log-likelihood. If the model specifies independent observations \(Y_i\sim N(\mu_i(\theta),\sigma^2)\), with known \(\sigma\), then, up to the model’s specified mean structure,
This expression assumes normal errors with the stated variance and conditional independence of observations given the model. If \(\sigma\) is estimated, its contribution must also be included in the likelihood and the estimation problem. A different error model requires its corresponding objective; the objective should not be replaced by least squares unless that is the intended model or a justified equivalent.
A constrained fit can be written as minimizing an objective \(Q(\theta;Y)\) over an admissible parameter set \(\Theta\):
A fit at a bound is not automatically a failed fit. It is a legitimate constrained estimate when the optimizer has completed according to the prespecified criteria and the estimate satisfies the constraints. It is still important to flag the boundary status: repeated boundary estimates can reveal that the data and design do not support interior estimates, or that the parameter range deserves review. Any change to bounds must be justified and made as a prespecified revision, not as a response that selectively improves particular results.
At a minimum, retain a row for every replicate. Useful fields include replicate and design identifiers, fitting status, parameter estimates when available, objective value, initialization identifier, boundary indicators, and a concise reason if no admissible estimate was obtained. Do not silently drop an unsuccessful fit or replace its estimate with the generating value. Later summaries can then use explicit outcome rules rather than an undocumented, filtered set of results.
Worked Examples
Worked Example: A Prespecified Normal-Mean Fit
Suppose a hypothetical replicate contains three concentrations, \(4.8\), \(5.1\), and \(5.4\) mg/L. The analysis model is \(Y_i\sim N(\theta,0.3^2)\), independently, with \(4\leq\theta\leq6\) mg/L. The fitting rule minimizes the negative log-likelihood, starts at \(4.5\) mg/L, and uses the same bounds for every replicate.
The sample mean is \(5.1\) mg/L. Under this model, maximizing the likelihood over the allowed interval gives \(\hat{\theta}=5.1\) mg/L, which is inside the bounds. The residual sum of squares is \( (4.8-5.1)^2+(5.1-5.1)^2+(5.4-5.1)^2=0.18\;(\text{mg/L})^2\).
The objective at the estimate is \( -2\ell=3\log(2\pi(0.3)^2)+0.18/(0.3)^2\). Since \(3\log(0.5655)\approx-1.710\) and \(0.18/0.09=2\), the value is approximately \(0.290\). The replicate record therefore contains an admissible estimate of \(5.1\) mg/L, this objective value, the specified starting value, and a non-boundary status. The negative objective value is not an error: a density can exceed one when expressed per unit of a sufficiently small measurement scale.
Worked Example: An Estimate at the Upper Bound
Use the same analysis model, known standard deviation \(0.3\) mg/L, and bounds \(4\leq\theta\leq6\) mg/L, but consider hypothetical observations \(6.8\), \(7.0\), and \(7.2\) mg/L. The starting value is \(5.9\) mg/L.
The unconstrained maximum-likelihood estimate is the mean, \((6.8+7.0+7.2)/3=7.0\) mg/L, which is outside the permitted interval. The constrained likelihood is maximized at the closest allowed point in this one-parameter problem, so \(\hat{\theta}=6.0\) mg/L. The residual sum of squares is \( (6.8-6.0)^2+(7.0-6.0)^2+(7.2-6.0)^2=0.64+1.00+1.44=3.08\;(\text{mg/L})^2\).
Thus, \( -2\ell=3\log(0.5655)+3.08/0.09\approx-1.710+34.22=32.51\). Record \(6.0\) mg/L as the constrained estimate and mark it as at the upper bound. If the optimizer satisfies the prespecified completion criteria, this is a boundary estimate, not an automatic failure. The result should not be silently changed to \(7.0\) mg/L, because that would report an estimate outside the prespecified parameter space.
Worked Example: Applying a Fixed Multi-Start Rule
Suppose a hypothetical analysis fits \(Y_i=a+bx_i+\epsilon_i\), where the errors are independent \(N(0,1)\), for observations \((x_i,Y_i)=(0,1.1),(1,2.8),(2,5.1)\). The bounds are \(0\leq a\leq3\) and \(0\leq b\leq4\). The prespecified rule fits from two starts, \((a,b)=(0.5,0.5)\) and \((2.5,3.5)\), and retains the admissible completed fit with the smaller objective.
The unconstrained least-squares estimates are \( \hat b=\sum_i(x_i-\bar{x})(Y_i-\bar{Y})/\sum_i(x_i-\bar{x})^2\) and \(\hat a=\bar{Y}-\hat b\bar{x}\). Here \(\bar{x}=1\), \(\bar{Y}=3.0\), the numerator is \((-1)(-1.9)+0(-0.2)+(1)(2.1)=4.0\), and the denominator is \(1+0+1=2\). Thus \(\hat b=2.0\) and \(\hat a=1.0\), both within their bounds.
The fitted values are \(1.0,3.0,5.0\), giving residuals \(0.1,-0.2,0.1\) and a residual sum of squares \(0.01+0.04+0.01=0.06\). With known variance 1 and \(n=3\), the objective is \(3\log(2\pi)+0.06\approx5.574\). Suppose, hypothetically, both starts return this estimate and objective and satisfy the prespecified completion criteria. The record should retain both start-specific outcomes and identify the selected result under the stated rule. The generating values, if any, play no role in deciding which fit to select.
Justification and Practical Checks
The reason for fixing the pipeline is straightforward. Let \(A\) denote the prespecified analysis rule and \(Y_r\) a replicate under a chosen design and scenario. The replicate-level result is \(A(Y_r)\). If the rule changes to \(A_r\) after inspecting each dataset, the output becomes \(A_r(Y_r)\), and variation in results can reflect both the simulated data and the changing analysis. Applying the same \(A\) makes the analysis contribution explicit and supports a like-for-like design evaluation.
This does not mean every dataset will produce a successful fit, or that one fitting method is suitable for every scientific question. It means the specified method is applied by a consistent rule and its outcomes are reported transparently. As a practical check, verify that the implemented model matches the written objective, that units and parameter transformations are consistent, and that the starting values fall within the permitted parameter space. Check also that every replicate receives an outcome record, including those without an admissible estimate.
A common mistake is to interpret a simulation as a test of the generating model alone and therefore initialize each fit at the true generating parameters. The reasoning is that a good start merely helps the optimizer. The correction is that the start is part of the operational analysis procedure: unless the truth would be known in the intended study, truth-based initialization gives the analysis information it would not have. Use the prespecified initialization rule instead, and retain the resulting outcome even when a fit is inconvenient.
Another mistake is to treat every boundary estimate as a computational failure, or to remove it before calculating later performance summaries. A boundary estimate may be the correct constrained optimum. Record it distinctly from an unsuccessful fit; the later interpretation depends on the performance question and explicit outcome rules. Conversely, a numeric parameter vector alone does not establish a valid fit: the prespecified completion and admissibility criteria must also be met.
State the model, objective, estimated parameters, parameterization, bounds, starts, and completion criteria before evaluating outcomes.
Apply the same rule for each replicate and design; do not use generating values to select starts or alter constraints.
Store estimates and objective values when available, along with status, start, and boundary indicators; preserve unsuccessful outcomes explicitly.
Limitations and Alternatives
A fixed pipeline makes comparisons interpretable but does not guarantee that the chosen estimation model is scientifically adequate or computationally robust. One starting value may be insufficient for a difficult objective; bounds may be too restrictive or too permissive; and the assumed error distribution may not represent the intended analysis. These are reasons to evaluate and justify the procedure before the simulation, not reasons to change it selectively after observing results.
A single-start procedure is simpler and may match the planned analysis exactly. A prespecified multi-start procedure can reduce dependence on one initial point, but costs more computation and requires a fixed selection rule, such as choosing the admissible completed fit with the smallest objective. If a real analysis would use a different approach, such as a distinct estimation method or a different initialization strategy, the simulation should implement that alternative when it is the method whose design performance is being evaluated. The comparison is meaningful only when each procedure is fully specified and outcomes are recorded under explicit rules.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A parameter is generated at \(2.5\) units in one replicate. Should the fit automatically start at \(2.5\)? Why or why not?
- In a normal-mean model with known standard deviation and bounds \(1\leq\theta\leq5\), the observations are \(5.6, 5.8, 6.0\). What is the constrained estimate, and how should its status be recorded?
- Why should a simulation retain a replicate record when the fitting procedure does not return an admissible estimate?
- Two prespecified starts produce completed fits with objectives \(18.2\) and \(17.9\). Under a rule selecting the smaller objective, which fit is retained, and what else should be recorded?
Solutions. (1) No. Unless the generating truth would be available in the intended analysis, using it leaks information; apply the prespecified initialization rule. (2) The unconstrained mean is \((5.6+5.8+6.0)/3=5.8\), so the constrained estimate is \(5\), recorded as an estimate at the upper bound if the fit meets completion criteria. (3) Otherwise later summaries would silently omit a possible analysis outcome and could describe only selected successful replicates; preserve the status and reason explicitly. (4) Retain the completed fit with objective \(17.9\), and record the start, estimates, objective, and status for both fits, as well as which one the selection rule retained.