romtools.workflows.inverse.eki_drivers#

Single-fidelity ensemble Kalman inversion drivers.

This module provides a derivative-free ensemble Kalman inversion (EKI) workflow for black-box forward models. The algorithm evolves an ensemble of parameter realizations so that the corresponding model outputs become consistent with observed quantities of interest.

Theory

run_eki solves a deterministic inverse problem by repeatedly updating an ensemble \(\{\theta^{(j)}\}_{j=1}^{J}\). At each iteration the forward model is evaluated on every ensemble member, producing QoIs \(g(\theta^{(j)})\). The ensemble mean prediction is compared with the observations \(y\), and the parameter ensemble is corrected with a Kalman-style affine update.

With parameter anomalies

\[S_{\theta} = \frac{1}{\sqrt{J-1}} \left[ \theta^{(1)} - \bar{\theta}, \ldots, \theta^{(J)} - \bar{\theta} \right],\]

and QoI anomalies

\[S_y = \frac{1}{\sqrt{J-1}} \left[ g(\theta^{(1)}) - \bar{g}, \ldots, g(\theta^{(J)}) - \bar{g} \right],\]

the implementation forms the update directions by solving

\[\Delta \Theta = S_{\theta} S_y^{\top} \left( S_y S_y^{\top} + \Gamma_y + \lambda I \right)^{-1} \left[ y - g(\theta^{(1)}), \ldots, y - g(\theta^{(J)}) \right],\]

where \(\Gamma_y\) is the observation covariance and \(\lambda\) is the Tikhonov regularization parameter. Each ensemble member is then updated by adding a scaled column of \(\Delta \Theta\).

Ensemble Rejuvenation

EKI can stagnate when the empirical parameter-observation cross-covariance collapses before the observation residual is small. run_eki can rejuvenate the ensemble by resampling around the current mean with an inflated covariance. Adaptive rejuvenation is triggered when the componentwise normalized RMS parameter update is below delta_params_tolerance while the residual remains above error_norm_tolerance. Periodic rejuvenation is also available. Adaptive rejuvenation uses a cooldown window after each event so a newly expanded ensemble can evolve before another rejuvenation is permitted.

The rejuvenation covariance is

\[C_{\mathrm{rejuv}} = \alpha C_{\theta,k} + \beta C_{\mathrm{ref},k},\]

with a parameter-scaled diagonal reference covariance

\[C_{\mathrm{ref},k} = \operatorname{diag}(s_1^2, \ldots, s_d^2), \qquad s_i = |\bar{\theta}_{k,i}|.\]

When a current parameter mean is numerically zero and finite lower and upper bounds are available, its admissible range is used as the reference scale. For an unbounded zero-mean parameter, the initial ensemble covariance provides a fallback scale. The default \(\beta=0.0025=0.05^2\) therefore produces a 5 percent standard-deviation perturbation about a nonzero current parameter mean when \(C_{\theta,k}\) has collapsed. Rejuvenation uses a deterministic seed based on the rejuvenation count so restart behavior is reproducible.

Step Acceptance

The routine uses a simple trust-region-like acceptance rule on top of the EKI update. A trial step is accepted when the mean observation-space error norm is below relaxation_parameter times the current value. Accepted steps grow the step size by step_size_growth_factor; rejected steps shrink it by step_size_decay_factor until either a step is accepted or the maximum number of retries is reached.

Practical Notes

  • The forward model is treated as derivative-free; only QoI evaluations are required.

  • Parameter bounds are enforced by clipping sampled, rejuvenated, and updated parameters to parameter_mins and parameter_maxes when provided.

  • Restart files store the ensemble, QoIs, current step size, rejuvenation count, and initial covariance used only as a zero-mean fallback scale.

Relation to run_mf_eki

run_eki is the single-fidelity baseline. The multifidelity driver romtools.workflows.inverse.mf_eki_drivers.run_mf_eki() augments this workflow with ROM control variates and adaptive surrogate rebuilding, but the high-fidelity correction and step-acceptance logic remain closely related.

Functions

compute_eki_update(parameter_samples, qois, ...)

compute_eki_update2(parameter_samples, qois, ...)