# Predictor–corrector method

(Redirected from Predictor-corrector method)

In mathematics, particularly numerical analysis, a predictor–corrector method is an algorithm that proceeds in two steps. First, the prediction step calculates a rough approximation of the desired quantity. Second, the corrector step refines the initial approximation using another means.

## Predictor–corrector methods for solving ODEs

When considering the numerical solution of ordinary differential equations (ODEs), a predictor­­–corrector method typically uses an explicit method for the predictor step and an implicit method for the corrector step.

### Example: Euler method with the trapezoidal rule

A simple predictor–corrector method (known as Heun's method) can be constructed from the Euler method (an explicit method) and the trapezoidal rule (an implicit method).

Consider the differential equation

$y' = f(t,y), \quad y(t_0) = y_0,$

and denote the step size by $h$.

First, the predictor step: starting from the current value $y_i$, calculate an initial guess value $\tilde{y}_{i+1}$ via the Euler method,

$\tilde{y}_{i+1} = y_i + h f(t_i,y_i).$

Next, the corrector step: improve the initial guess using trapezoidal rule,

$y_{i+1} = y_i + \tfrac12 h \bigl( f(t_i, y_i) + f(t_{i+1},\tilde{y}_{i+1}) \bigr).$

That value is used as the next step.

### PEC mode and PECE mode

There are different variants of a predictor­–corrector method, depending on how often the corrector method is applied. The Predict–Evaluate–Correct–Evaluate (PECE) mode refers to the variant in the above example:

\begin{align} \tilde{y}_{i+1} &= y_i + h f(t_i,y_i), \\ y_{i+1} &= y_i + \tfrac12 h \bigl( f(t_i, y_i) + f(t_{i+1},\tilde{y}_{i+1}) \bigr). \end{align}

It is also possible to evaluate the function f only once per step by using the method in Predict–Evaluate–Correct (PEC) mode:

\begin{align} \tilde{y}_{i+1} &= y_i + h f(t_i,\tilde{y}_i), \\ y_{i+1} &= y_i + \tfrac12 h \bigl( f(t_i, \tilde{y}_i) + f(t_{i+1},\tilde{y}_{i+1}) \bigr). \end{align}

Additionally, the corrector step can be repeated in the hope that this achieves an even better approximation to the true solution. If the corrector method is run twice, this yields the PECECE mode:

\begin{align} \tilde{y}_{i+1} &= y_i + h f(t_i,y_i), \\ \hat{y}_{i+1} &= y_i + \tfrac12 h \bigl( f(t_i, y_i) + f(t_{i+1},\tilde{y}_{i+1}) \bigr). \\ y_{i+1} &= y_i + \tfrac12 h \bigl( f(t_i, y_i) + f(t_{i+1},\hat{y}_{i+1}) \bigr). \end{align}

The PECEC mode has one fewer function evaluation. More generally, if the corrector is run k times, the method is in P(EC)k or P(EC)kE mode. If the corrector method is iterated until it converges, this could be called PE(CE).[1]