20.29 Worked example: SAEM followed by importance sampling
SAEM is a stochastic estimation workflow. Its burn-in, accumulation, chain configuration, proposal behavior and importance-sampling evaluation all matter. The chapter example is intentionally short so readers can observe a stationarity warning; it is a teaching run, not a production recommendation.
nlmx fit documents/ch20/input/run20_saem.ctl `
--output documents/ch20/results/oral_saem `
--overwrite --approximation saem --seed 20261103 `
--no-cov-step --carry-columns WT,GROUP --plots --plot-format both
The run used two chains per subject, 120 burn-in iterations and 80 accumulation iterations. Burn-in reached NBURN=120 without passing the stationarity test, so the listing correctly says minimization was not completed. Acceptance rates were 0.09 for the prior kernel, 0.40 for random walk and 0.41 for the component kernel; the latter two were at the reported 0.40 target. MU links were recognized for log-scale CL and V.
The final SAEM trace objective was −646.9183, but the listing explicitly states that it is not a likelihood. The reportable OFV, −420.9599, came from importance sampling with 300 draws per subject. The multivariate-t proposal used antithetic sampling; effective sample size was at least 243 and had a median of 257. These diagnostics belong beside the OFV in any review.
The estimates were CL 3.78144 L/h, V 42.9832 L and KA 1.15453 1/h. The additive residual SD moved effectively to zero (9.53e-9), reinforcing the boundary concern seen in the deterministic runs. A longer SAEM run may address stationarity but will not automatically make an unnecessary error component identifiable.
Production practice
Use an explicit seed; increase burn-in and accumulation based on trace behavior; repeat with multiple seeds; compare parameter and likelihood stability; inspect acceptance and ESS; and perform a final covariance/uncertainty workflow suited to the method. Treat reproducibility as a distributional/numerical assessment, not a demand that unrelated seeds produce identical trajectories.
Common mistakes
- Reporting the SAEM trace objective as the OFV.
- Ignoring failure of the stationarity test.
- Using one short chain configuration as production evidence.
- Changing the seed without recording it.
- Assuming acceptable ESS proves model adequacy.
Checklist
- Record seed, burn-in, accumulation, chains and IS draws.
- Review stationarity, kernel acceptance and trace stability.
- Use the importance-sampling OFV for likelihood reporting.
- Repeat across seeds and compare estimates.
- Resolve boundary and covariance issues before final reporting.
Further reading
Continue with estimation controls, evaluate-only and rescue, and validation.