fips.estimators.BayesianSolver#

class fips.estimators.BayesianSolver(z, x_0, H, S_0, S_z, c=None, gamma=1.0)[source]#

Bayesian inversion estimator class.

This class implements a Bayesian inversion framework for solving inverse problems, also known as the batch method.

The regularization factor (gamma) controls the balance between fitting observations and staying close to the prior. In the cost function, gamma (γ) multiplies the observation term: J(x) = (x - x_0)^T S_0^{-1} (x - x_0) + gamma*(z - Hx)^T S_z^{-1} (z - Hx)

This amounts to scaling S_z by 1/gamma.

  • gamma > 1: Increases weight on data fitting (less regularization, fits observations more closely)

  • gamma = 1: Standard Bayesian inversion (default)

  • gamma < 1: Decreases weight on data fitting (more regularization, stays closer to prior)

Parameters:
  • z (np.ndarray) – Observed data

  • x_0 (np.ndarray) – Prior model estimate

  • H (np.ndarray) – Forward operator

  • S_0 (np.ndarray) – Prior error covariance

  • S_z (np.ndarray) – Model-data mismatch covariance

  • c (np.ndarray | float, optional) – Constant data, defaults to 0.0

  • gamma (float, optional) – Regularization factor (γ) that multiplies the observation term in the cost function, by default 1.0

Attributes

S_hat

Posterior Error Covariance Matrix with regularization.

U_red

Uncertainty reduction vector.

desroziers

Desroziers et al. (2005) diagnosed observation error covariance.

reduced_chi2

Reduced Chi-squared statistic.

uncertainty_reduction

Uncertainty reduction metric.

x_hat

Posterior Mean Model Estimate (solution).

y_0

Prior mean data estimate.

y_hat

Posterior mean observation estimate.

gamma

Regularization factor (γ) that multiplies the observation term in the cost function.

z

Observed data.

x_0

Prior model state estimate.

S_z

Model-data mismatch covariance.

c

Constant data, which can be a scalar or an array matching the shape of z.

n_z

Number of observations (length of z).

n_x

Number of state variables (length of x_0).

Methods

cost(x)

Cost function with regularization.

forward(x)

Forward model calculation.

leverage(x)

Calculate the leverage matrix.

residual(x)

Forward model residual.