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
Posterior Error Covariance Matrix with regularization.
U_redUncertainty reduction vector.
desroziersDesroziers et al. (2005) diagnosed observation error covariance.
reduced_chi2Reduced Chi-squared statistic.
uncertainty_reductionUncertainty reduction metric.
Posterior Mean Model Estimate (solution).
y_0Prior mean data estimate.
y_hatPosterior mean observation estimate.
gammaRegularization factor (γ) that multiplies the observation term in the cost function.
zObserved data.
x_0Prior model state estimate.
S_zModel-data mismatch covariance.
cConstant data, which can be a scalar or an array matching the shape of z.
n_zNumber of observations (length of z).
n_xNumber 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.