Concept Architecture
Nelder-Mead Method for Calibrating Health Economic Models
The Nelder-Mead method is a direct search routine that finds parameter values giving the lowest score on an objective, such as the distance between model outputs and calibration targets or a negative log-likelihood. It compares the score at a small set of trial points and keeps replacing the worst one, so it needs only the ability to run the model and read off a number. That property explains its long use in health economics, where natural history parameters of a Markov model or a microsimulation often cannot be observed directly and must be inferred by calibration. It is one of several forms of numerical optimisation and is unrelated to the simplex method of linear programming.
How the simplex moves towards a lower score
For a problem with unknown parameters, the method keeps a simplex of points, a triangle when there are two. Nelder and Mead described it in 1965 as a method for minimising a function of variables in which the vertex with the highest value is replaced by another point, so that the simplex adapts to the local shape of the function. Lagarias, Reeds, Wright and Wright later stated the algorithm precisely, adding tie-breaking rules the original paper left open, and the rules below follow them.
Each iteration orders the vertices so that has the lowest score and the highest, then computes the centroid of all vertices except the worst.
where is the centroid, is the th best vertex and is the number of parameters. Every candidate point in a normal iteration lies on the line through the worst vertex and this centroid.
where is the reflected point, the expanded point, the outside contraction point, the inside contraction point and the shrunk position of vertex . The coefficients are for reflection, for expansion, for contraction and for shrinkage, and Lagarias and colleagues describe , , and as the nearly universal standard choice.
The choice among these points follows the ordering of scores. Writing , and for the best, next-worst and worst scores and for the score at , the iteration runs as follows.
- Reflect. If , the reflected point replaces the worst vertex.
- Expand. If , the expanded point is kept if it beats , and is kept if it does not.
- Contract outside. If , the point is tried and kept if its score is no worse than .
- Contract inside. If , the point is tried and kept if it beats the worst vertex.
- Shrink. If a contraction fails, every vertex except the best moves halfway towards .
A normal iteration costs one or two model runs, and a shrink costs more. Each run can be a full simulation of a cohort or of many individuals, so evaluations matter more than iterations.
Uses in calibration and likelihood fitting
Stout and colleagues named the Nelder-Mead algorithm among the directed searches used in cancer simulation models. Taylor and colleagues compared three ways of calibrating a Markov model of human papillomavirus infection and cervical disease to US data. Nelder-Mead gave the best fit, a mean deviation of 7% from the targets against 10% for manual calibration, using substantially less analyst time but more computing, while random search reached 39%.
Nelder-Mead is the default method of the optim function in R, described in its documentation as using only function values and as relatively slow but reasonably effective for non-differentiable functions. The calibrate_model function in the heemod package for Markov models lists Nelder-Mead first among its methods and accepts a table of starting values, running once per row so that results from different starts can be compared.
The method also fits statistical models whose likelihood is awkward to differentiate, for example a parametric survival model estimated by maximum likelihood estimation with a custom likelihood. The 1965 paper already gave a procedure for estimating the Hessian matrix near the minimum, which statistical estimation needs for standard errors. In R, optim can return a numerically differentiated Hessian at the solution found, which is needed because the simplex itself carries no curvature information.
Choices that change the answer
The analyst supplies a starting point and, directly or through defaults, the size of the first simplex. A small simplex searches only near the start, and a start in the wrong basin can end in a local minimum that looks like a good fit.
Scaling matters because the moves treat all directions alike. A transition probability near 0.01 and a scale parameter measured in years differ by orders of magnitude, so a simplex sized for one is badly sized for the other. R provides a parscale control for this, and many calibrations instead search on log or logit scales, which also keeps probabilities inside zero and one.
Stopping rules differ between implementations. R stops when a step cannot reduce the score by a relative tolerance, reltol, of about one part in a hundred million by default, or after 500 iterations for Nelder-Mead. SciPy uses absolute tolerances on the parameters and the score and defaults to 200 iterations per parameter. A run that ends on the iteration limit has not converged, and R reports it with code 1, while code 10 reports a degenerate simplex.
Bounds are handled crudely or not at all, because the basic method is for unconstrained problems. In R, supplying non-trivial bounds to optim switches the method to L-BFGS-B with a warning, and in SciPy bounds on the Nelder-Mead method simply clip the vertices. Transforming the parameters or a constrained optimisation method is usually cleaner. For a single parameter, R warns that the default method works poorly and points to the Brent method.
Worked example fitting a Weibull curve to two landmark survival figures
All numbers in this example are illustrative. A model needs a survival curve for a patient group whose only published evidence is overall survival of 80% at 5 years and 60% at 10 years. The analyst assumes a Weibull distribution and calibrates its two parameters to these two figures.
where is the proportion alive at year , is the shape parameter and is the scale parameter in years. The score is the sum of squared gaps in percentage points.
where is the goodness of fit score to be minimised. The standard coefficients are used throughout.
1. Starting simplex. The vertices are A = (1.0, 20), B = (1.5, 20) and C = (1.0, 25), written as (, ). At A, and , so the gaps are 2.12 and 0.65 points and the score is 4.49 plus 0.43, or 4.92. The same working gives 172.48 at B and 52.96 at C, so A is best, C next-worst and B worst.
2. Centroid and reflection. The centroid of A and C is (1.0, 22.5). Reflecting B through it gives , with survival of 0.6394 and 0.5313 and a score of 305.12.
3. Inside contraction. The reflected score is worse than the worst vertex, so the inside point is tried, . Its score of 83.49 beats 172.48, so it replaces B.
4. The next five iterations. Each row starts from the simplex left by the row before.
| Iteration | Move | New vertex (, ) | Score |
|---|---|---|---|
| 2 | Reflection | (0.75, 23.75) | 45.58 |
| 3 | Inside contraction | (0.9375, 23.4375) | 15.04 |
| 4 | Outside contraction | (1.0781, 20.7031) | 11.61 |
| 5 | Reflection, expansion rejected | (1.1406, 17.2656) | 4.83 |
| 6 | Inside contraction | (1.0742, 19.6680) | 3.02 |
At iteration 5 the reflected score of 4.83 beat the best score of 4.92, so the expansion to (1.2422, 14.1797) was tried, but it scored 74.89 and the reflected point was kept. After six iterations and 14 model evaluations the best vertex gives survival of 79.5% at 5 years and 61.7% at 10 years.
5. Convergence. After 30 iterations and 60 evaluations the best vertex is , , with a score below one millionth. The exact solution follows from the two targets. Since , the shape is , and .
6. Interpretation. The search found the right answer quickly, but the problem is easy. Two parameters meet two targets exactly and the solution is unique. A zero score shows only that the curve passes through both points. Another two-parameter family through the same points would extrapolate differently beyond 10 years, and that choice belongs to model structure rather than to the optimiser.
What convergence does and does not show
Theory offers little reassurance. Lagarias and colleagues proved convergence to a minimiser for strictly convex functions of one variable and only limited results for two. They cite a counterexample by McKinnon, a family of strictly convex functions of two variables and starting simplices for which the method converges to a point that is not a minimiser. For general nonconvex functions, they conclude, it does not converge to a minimiser, and the open question is why it tends to work well in practice by producing a rapid initial fall in the score.
A run that stops should be restarted from its best point with a fresh simplex, since an answer that moves on restart was not a minimum, and runs from several dispersed starting points show whether the search keeps finding the same basin. The convergence of the algorithm should also be kept apart from identification, since a model with more free parameters than informative targets can fit equally well at many parameter sets.
Stochastic models add a further problem. In a microsimulation each score carries Monte Carlo error, and because the method acts only on the ranking of vertex scores, noise can reverse a ranking and send the simplex the wrong way. Common random numbers for every evaluation, or enough simulated individuals that the noise is small beside real differences in fit, reduce this.
Nelder-Mead beside other search methods
Methods that use derivatives usually reach a smooth minimum in fewer evaluations. Gradient descent steps against the slope, the Newton-Raphson method adds curvature and the BFGS method in R uses function values and gradients. Nelder-Mead suits problems with a handful of parameters where gradients are unavailable or unreliable, and SciPy presents its adaptive option, which sets the coefficients by dimension, as useful for high-dimensional minimisation.
Grid search evaluates a fixed lattice and grows rapidly with the number of parameters. Simulated annealing and a genetic algorithm use random moves to escape local minima, and Bayesian optimisation fits a surrogate to earlier runs when each run is slow. The Solver add-in for Excel does not offer Nelder-Mead. Microsoft lists GRG Nonlinear for smooth nonlinear problems, Simplex LP for linear problems and Evolutionary, based on genetic algorithms, for non-smooth problems, and Simplex LP is the linear programming method that Lagarias and colleagues distinguish from Nelder-Mead.
Common misreadings
Most errors come from treating the point where the search stopped as more than it is. The analyst still has to show that the stopping point is a credible answer.
- Reading a success code as proof of a global minimum. The code means only that a stopping rule was met, so restarts and multiple starting points are still needed.
- Treating a near-zero score as a validated model. A good fit to calibration targets leaves extrapolation and structural choices untested.
- Ignoring scale. Parameters of very different magnitude distort the simplex unless they are rescaled or transformed.
- Expecting standard errors from the simplex. Uncertainty needs a separate Hessian estimate or a probabilistic or Bayesian calibration.
Sources
- Lagarias JC, Reeds JA, Wright MH, Wright PE. Convergence properties of the Nelder-Mead simplex method in low dimensions. SIAM Journal on Optimization. 1998;9(1):112-147. https://doi.org/10.1137/S1052623496303470
- Microsoft. Define and solve a problem by using Solver. Microsoft Support, accessed 26 October 2026. https://support.microsoft.com/en-us/office/define-and-solve-a-problem-by-using-solver-5d1a388f-079d-43ac-a7eb-f63e45925040
- Nelder JA, Mead R. A simplex method for function minimization. The Computer Journal. 1965;7(4):308-313. https://doi.org/10.1093/comjnl/7.4.308
- R Core Team. optim: General-purpose Optimization. R documentation, package stats, accessed 26 October 2026. https://stat.ethz.ch/R-manual/R-devel/library/stats/html/optim.html
- SciPy community. minimize(method='Nelder-Mead'). SciPy v1.18.0 manual, accessed 26 October 2026. https://docs.scipy.org/doc/scipy/reference/optimize.minimize-neldermead.html
- Stout NK, Knudsen AB, Kong CY, McMahon PM, Gazelle GS. Calibration methods used in cancer simulation models and suggested reporting guidelines. PharmacoEconomics. 2009;27(7):533-545. https://doi.org/10.2165/11314830-000000000-00000
- Taylor DC, Pawar V, Kruzikas D, Gilmore KE, Pandya A, Iskandar R, Weinstein MC. Methods of model calibration: observations from a mathematical model of cervical cancer. PharmacoEconomics. 2010;28(11):995-1000. https://doi.org/10.2165/11538660-000000000-00000
- Zarca K, Filipovic-Pierucci A, et al. heemod: Markov Models for Health Economic Evaluations. R package version 1.1.0, CRAN, 2025. Reference manual, calibrate_model. https://cran.r-project.org/web/packages/heemod/refman/heemod.html
Related Concepts (1)
Library
Publications
1
A Taxonomy of Model Structures for Economic Evaluation of Health Technologies — Brennan, Chick & Davies, Vol. 15, No. 12 ed., 2006 (Health Economics)
An influential paper classifying decision-analytic model structures along axes of expected value vs randomness, entity heterogeneity, and Markovian vs non-Markovian structure — providing a framework for choosing between decision trees, Markov cohort models, microsimulation, discrete event simulation and system dynamics.
Journal ArticleView source →
Frequently Asked Questions (6)
What is the Nelder-Mead method?
The Nelder-Mead method is a derivative-free algorithm that moves a simplex of trial points to minimise a score, used to calibrate health economic models.
Source: Nelder & Mead 1965
What kind of problems suit the Nelder-Mead method?
The method is intended for unconstrained minimisation in which a score can be computed but its derivatives cannot, because it works from function values alone and uses no derivative information. That fits health economic calibration, where each evaluation may be a full run of a Markov model or a microsimulation that returns a single measure of distance from the targets. Lagarias and colleagues observe that it tends to produce a rapid initial fall in the score, which helps when every run is slow. It works best with a handful of parameters, rescaled or transformed so that probabilities and durations sit on comparable scales.
Source: Lagarias et al. 1998
How does the Nelder-Mead method work?
For a problem with n unknown parameters, the Nelder-Mead method keeps a simplex of n + 1 trial points and ranks them by their score. Each iteration reflects the worst point through the centroid of the others, and a reflected point scoring between the best and the next-worst simply replaces the worst vertex. If it beats the best vertex, an expansion further along the same line is tried, and if it is no better than the next-worst, an outside or inside contraction is tried instead. When a contraction fails, every vertex except the best moves halfway towards it. The standard coefficients are 1 for reflection, 2 for expansion and one half for contraction and shrinkage.
Source: Lagarias et al. 1998
Why is the Nelder-Mead method derivative-free?
Nelder and Mead built the method on comparisons of function values at the n + 1 vertices of a simplex, with the vertex holding the highest value replaced by another point at each step. No slope or curvature is ever calculated, so the search needs only the ability to run the model and read off a score. Because the moves depend only on how the vertex scores rank, the method can be applied to a likelihood that is awkward to differentiate or to a simulation that yields no derivatives. The same lack of curvature information is why the 1965 paper added a separate procedure for estimating the Hessian matrix near the minimum, which statistical estimation needs for standard errors.
Source: Nelder & Mead 1965
When is the Nelder-Mead method used?
In health economics the Nelder-Mead method is used mainly to calibrate models whose natural history parameters cannot be observed directly, such as a Markov model fitted to published targets. Taylor and colleagues compared three ways of calibrating a Markov model of human papillomavirus infection and cervical disease to US data. Nelder-Mead gave the best fit, with a mean deviation of 7% from the targets against 10% for manual calibration and 39% for random search. It needed substantially less analyst time than manual calibration but more computing, a trade that matters when each model run is a slow simulation.
Source: Taylor et al. 2010
What are the limitations of the Nelder-Mead method?
Theory gives the Nelder-Mead method little support, since Lagarias and colleagues proved convergence to a minimiser only for strictly convex functions of one variable and limited results for two. They cite McKinnon's counterexample, a family of strictly convex functions of two variables for which the method converges to a point that is not a minimiser, and for general nonconvex functions it does not converge to a minimiser. The basic method is also intended for unconstrained problems, so bounds are handled crudely or not at all. In practice a stopping point needs restarts from fresh simplices and several dispersed starting points before it is treated as a minimum.
Source: Lagarias et al. 1998
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 27 Oct 2026
Content version: 1.0.1
Canonical Identity
- Persistent URI
- https://healtheconomics.wiki/concept/nelder-mead-method
- Term code
- HE-EM-DM-069
Stable URI · Machine-readable · Resolvable · CC BY 4.0
