esmda#

resmda.data_assimilation.esmda(model_prior, forward, data_obs, sigma, alphas=4, data_prior=None, localization_matrix=None, callback_post=None, return_post_data=True, return_steps=False, random=None)[source]#

ES-MDA algorithm ([EmRe13]) with optional localization.

Consult the section ES-MDA in the manual for the theory and more information about ES-MDA.

Parameters:
model_priorndarray

Prior models of dimension (ne, ...), where ne is the number of ensembles.

forwardcallable

Forward model that takes an ndarray of the shape of the prior models (ne, ...), and returns a ndarray of the shape of the prior data (ne, nd); ne is the number of ensembles, nd the number of data.

data_obsndarray

Observed data of shape (nd).

sigma{float, ndarray}

Standard deviation(s) of the observation noise.

alphas{int, array-like}, default: 4

Inflation factors for ES-MDA.

data_priorndarray, default: None

Prior data ensemble, of shape (ne, nd).

callback_postfunction, default: None

Function to be executed after each ES-MDA iteration to the posterior model, callback_post(model_post).

return_post_databool, default: True

If true, returns also forward(model_post).

return_stepsbool, default: False

If true, returns model and data of all ES-MDA steps. Setting return_steps to True enforces return_post_data=True.

random{None, int, np.random.Generator}, default: None

Seed or random generator for reproducibility; see resmda.utils.rng.

localization_matrix{ndarray, None}, default: None

If provided, apply localization to the Kalman gain matrix, of shape (model-shape, nd).

Returns:
model_postndarray

Posterior model ensemble.

data_postndarray, only returned if return_post_data=True

Posterior simulated data ensemble.