AI Glossary / Mathematics and optimization / Intermediate
Order of accuracy
Definition
Order of accuracy describes how quickly a numerical method's approximation error decreases as its step size or grid spacing becomes smaller. If the leading error behaves like a constant times h to the power p, the method has order p in that setting. The concept helps predict the benefit of refinement, rather than stating how many correct digits a particular calculation already has.
What it means
A first-order error typically shrinks by about two when the spacing is halved; a second-order error shrinks by about four; a fourth-order error shrinks by about sixteen. These comparisons apply when the leading error term dominates and the required smoothness and stability conditions hold. The constant multiplying that term also matters. A higher-order method can therefore be less accurate at a particular coarse resolution than a lower-order method. Always identify the error being discussed: a derivative approximation, a local time-stepping error, or the accumulated solution error are related but distinct quantities.
How it works
Analysts often expand a formula using a Taylor series and identify the first error term that does not cancel. For a smooth function, the forward difference [f(x + h) − f(x)]/h approximates its derivative with an error of order h. The centered difference [f(x + h) − f(x − h)]/(2h) cancels the first-order term and usually has error of order h². In an experiment with a known exact answer, compute errors at several spacings and inspect their ratios. An observed order estimate is log(error at h divided by error at h/2) divided by log(2). This estimate is meaningful only when the errors are nonzero, measured consistently and not dominated by unrelated effects.
Three practical examples
- A simulation developer compares grid refinements to check whether a spatial derivative implementation achieves its intended second-order behavior.
- A numerical integration study compares error reduction against the extra function evaluations required by a more accurate quadrature rule.
- A team fitting a scientific model checks whether numerical derivative errors are small enough that the optimizer is responding to the model rather than to discretization artifacts. The best choice depends on the whole calculation, not just a method's advertised order.
Think of it this way
Think of measuring a curved path with shorter straight segments. Smaller segments can reduce approximation error in a predictable pattern. The analogy captures refinement, but not a universal rate: the geometry, measurement rule and smoothness determine the actual order. Shortening segments cannot correct an incorrectly drawn path or inaccurate measuring instrument.
Worked example
Take f(x) = x³ and estimate its derivative at x = 1, whose exact value is 3. A forward difference gives [(1 + h)³ − 1]/h = 3 + 3h + h². At h = 0.1, the estimate is 3.31 and the absolute error is 0.31. At h = 0.05, the estimate is 3.1525 and the error is 0.1525. The ratio 0.31/0.1525 is approximately 2.033, approaching the expected factor of two as h decreases. The centered difference gives [(1 + h)³ − (1 − h)³]/(2h) = 3 + h². Its errors are 0.01 and 0.0025 at the same spacings, a ratio of exactly four in exact arithmetic. The observed order is therefore log(4)/log(2) = 2. This polynomial example isolates truncation error; actual floating-point evaluation can depart from these identities at extremely small spacings.
Illustrative case study
In a fictional project, Alder Thermal develops a model of heat flow through a component. The team checks its derivative routine on a smooth function with a known answer before using it in a larger simulation. Although the interior calculation shows second-order behavior, the complete model initially converges more slowly because of its boundary treatment. The developers investigate the boundary formulas and repeat the refinement study. This illustrates why a correct component does not by itself establish the accuracy order of the entire solver; it does not claim any measured business saving.
Common misconceptions and mistakes
Second-order accuracy does not mean two decimal places or an error of two percent. A small grid does not guarantee a correct physical model. Local truncation error and global error should not be assigned the same exponent without analysis; for a usual order-p one-step ordinary differential equation method, the unnormalized single-step local error is of order h to the power p + 1. Definitions that divide the local residual by h use a different convention. Roundoff, measurement noise, nonsmooth solutions and instability can also prevent the expected refinement trend. A special test function may cancel an error coefficient and make a method look better than its general order.
Business use
Use order studies to support a defensible resolution choice for simulations and analytical tools. Record the quantity of interest, error norm, sequence of resolutions, runtime and reference answer. When the exact answer is unavailable, compare successive refinements cautiously and consider an independently accurate reference. Check whether the additional numerical accuracy changes a business decision enough to justify its cost. Separate discretization uncertainty from uncertainty in demand, material properties or model assumptions. A convincing refinement trend supports the numerical implementation; it does not validate every assumption behind the application.
People also ask
Is higher order always faster?
No. Each step may require more work, and the benefit depends on the accuracy target and problem.
Can smaller steps increase total error?
Yes. Roundoff or noise can become dominant as differences are divided by a very small spacing.
Can a method have different space and time orders?
Yes. A simulation can use one order for spatial discretization and another for time integration, and either error can dominate.
Check your understanding
A method's error falls from 0.008 to 0.002 when its spacing is halved. What order does that pair suggest?
Answer: Second order, because the reduction factor is four. Additional refinements are needed to establish a reliable trend rather than a coincidental ratio.
Related terms
- Convergence
- truncation error
- numerical stability
- grid refinement
- Richardson extrapolation
- floating-point roundoff
Learn next
reproduce the cubic example and extend the spacing sequence until floating-point effects become visible. Then test a function whose derivatives do not vanish and compare forward and centered formulas using both error and computation cost.
More in Mathematics and optimization
- Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
- Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
- Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
- Σ-algebra
- Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
- Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.
Sources
Sources: Tobin A. Driscoll and Richard J. Braun, Fundamentals of Numerical Computation, Convergence of finite differences, https://fncbook.com/python/fd-converge/ ; Finite differences, https://fncbook.com/finitediffs/ . The cubic calculation, refinement question and fictional thermal project are original explanatory examples.
Previous: Order effect Next: Order of integration