Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Weak-Constrained 4DVar

CSIC
UCM
IGEO

Strong-constraint 4DVar assumes the forward model is exact. In reality models carry biases, omit physics, and accumulate discretisation error. Weak-constraint 4DVar addresses this by treating model error itself as a control variable Trémolet, 2006: the dynamics are allowed to be wrong by an amount ηt\boldsymbol{\eta}_t at each step, and the analysis estimates those errors alongside the initial state.

Notation follows the strong-constraint note: state ut\boldsymbol{u}_t, background ub\boldsymbol{u}_b, covariances B\mathbf{B} / Rt\mathbf{R}_t, free-run dynamics MtfreeM_t^{\text{free}}, observation operator HtH_t — plus the model-error ηt\boldsymbol{\eta}_t with covariance Qt\mathbf{Q}_t.

Cost Function

The state now evolves under noisy dynamics,

ut=Mtfree(ut1)+ηt,ηtN(0,Qt),\boldsymbol{u}_t = M_t^{\text{free}}(\boldsymbol{u}_{t-1}) + \boldsymbol{\eta}_t, \qquad \boldsymbol{\eta}_t \sim \mathcal{N}(\boldsymbol{0}, \mathbf{Q}_t),

so the control vector expands from u0\boldsymbol{u}_0 to the augmented (u0,η1,,ηT)(\boldsymbol{u}_0, \boldsymbol{\eta}_1, \ldots, \boldsymbol{\eta}_T). The cost gains a third, model-error term:

J(u0,η)=12u0ubB12background+12t=0TytHt(ut)Rt12observations+12t=1TηtQt12model error,J(\boldsymbol{u}_0, \boldsymbol{\eta}) = \underbrace{\tfrac{1}{2} \| \boldsymbol{u}_0 - \boldsymbol{u}_b \|^2_{\mathbf{B}^{-1}}}_{\text{background}} + \underbrace{\tfrac{1}{2} \sum_{t=0}^{T} \| \boldsymbol{y}_t - H_t(\boldsymbol{u}_t) \|^2_{\mathbf{R}_t^{-1}}}_{\text{observations}} + \underbrace{\tfrac{1}{2} \sum_{t=1}^{T} \| \boldsymbol{\eta}_t \|^2_{\mathbf{Q}_t^{-1}}}_{\text{model error}},

with the trajectory recovered by recursively stepping (1).

Why the Model-Error Term Matters

Letting ηt\boldsymbol{\eta}_t absorb per-step errors improves the fit at every time without distorting u0\boldsymbol{u}_0. It fixes two failure modes of the strong constraint:

Climatological drift
Missing fast physics

The free model’s climatology differs from reality. Over a long window uT\boldsymbol{u}_T drifts away from the observations regardless of the initial condition, forcing a strong-constraint analysis to distort u0\boldsymbol{u}_0 to compensate. The model-error term lets the drift be corrected step by step.

Implementation

The augmented control (u0,η)(\boldsymbol{u}_0, \boldsymbol{\eta}) is a PyTree; the gradient over it comes from autodiff, and a general optimiser (optimistix) handles the minimisation.

import jax
import jax.numpy as jnp
import einx
from jaxtyping import Array, Float

def weak_4dvar_cost(
    u0:  Float[Array, "N"],       # initial state
    eta: Float[Array, "T N"],     # model-error trajectory η₁..η_T
    ub:  Float[Array, "N"],       # background
    ys:  Float[Array, "T M"],     # observations
    M,                            # free-run step:  u -> M^free(u)
    H,                            # observation operator:  u -> H(u)
    apply_B_inv,                  # v -> B⁻¹ v
    apply_R_inv,                  # v -> R⁻¹ v
    apply_Q_inv,                  # v -> Q⁻¹ v
) -> Float[Array, ""]:
    # roll the noisy trajectory:  u_t = M(u_{t-1}) + η_t
    def step(u_prev, eta_t):
        u_t = M(u_prev) + eta_t
        return u_t, u_t
    _, traj = jax.lax.scan(step, u0, eta)                       # (T, N)

    db  = u0 - ub
    Jb  = 0.5 * einx.dot("N, N ->", db, apply_B_inv(db))        # background
    res = ys - jax.vmap(H)(traj)                                # (T, M)
    Jo  = 0.5 * jnp.sum(jax.vmap(lambda r: einx.dot("M, M ->", r, apply_R_inv(r)))(res))
    Jq  = 0.5 * jnp.sum(jax.vmap(lambda e: einx.dot("N, N ->", e, apply_Q_inv(e)))(eta))
    return Jb + Jo + Jq

# gradient over the augmented control (u0, η)
grad_J = jax.grad(weak_4dvar_cost, argnums=(0, 1))

Choosing the model-error covariance Q\mathbf{Q}

Computational Cost

The control dimension grows with the window length TT,

dim(control)=dim(u0)+Tdim(ut).\dim(\text{control}) = \dim(\boldsymbol{u}_0) + T \cdot \dim(\boldsymbol{u}_t).

For T=100T = 100 and a 2D field with Du=104D_u = 10^4, that is 106\sim 10^6 control variables instead of 104 — a large jump in the minimisation cost. Two mitigations:

Limiting Cases

The model-error covariance interpolates a whole spectrum of methods:

LimitBehaviourReduces to
T=0T = 0η\boldsymbol{\eta} is empty3DVar / OI
Q1\mathbf{Q}^{-1} \to \infty (tight)ηt0\boldsymbol{\eta}_t \to \boldsymbol{0}strong-constraint 4DVar
Q10\mathbf{Q}^{-1} \to 0 (loose)observations dominatetrajectory ignores the dynamics

That strong-constraint is the tight-Q\mathbf{Q} limit is the cleanest way to see why weak 4DVar can only help (at the cost of more control variables) when the model genuinely has error.

Posterior

The Laplace posterior is Gaussian over the augmented control (u0,η)(\boldsymbol{u}_0, \boldsymbol{\eta}), with a block covariance over that joint space. Marginalising to the state trajectory {ut}t=0T\{\boldsymbol{u}_t\}_{t=0}^{T} means applying the linearised forward at each time and propagating the covariance — implementation-heavy and rarely needed. When full trajectory uncertainty matters, an ensemble smoother is usually preferable.

When Weak-Constraint 4DVar Is the Right Answer

Use it when…
Reach for something else when…
  • Observations span multiple times.

  • The model has known biases (climatological drift, missing physics).

  • Long windows show obvious late-time misfits in a strong-constraint analysis.

  • A reasonable Qt\mathbf{Q}_t is available (from model-to-reanalysis comparison).

References
  1. Trémolet, Y. (2006). Accounting for an Imperfect Model in 4D-Var. Quarterly Journal of the Royal Meteorological Society, 132(621), 2483–2504. 10.1256/qj.05.224
  2. Fisher, M., Leutbecher, M., & Kelly, G. A. (2005). On the Equivalence between Kalman Smoothing and Weak-Constraint Four-Dimensional Variational Data Assimilation. Quarterly Journal of the Royal Meteorological Society, 131(613), 3235–3246. 10.1256/qj.04.142
  3. Daescu, D. N., & Todling, R. (2010). Adjoint Sensitivity of the Model Forecast to Data Assimilation System Error Covariance Parameters. Quarterly Journal of the Royal Meteorological Society, 136(653), 2000–2012. 10.1002/qj.693