ewatercycle_DA.data_assimilation_schemes.PF

Module Contents

class ewatercycle_DA.data_assimilation_schemes.PF.ParticleFilter

Bases: pydantic.BaseModel

Implementation of a particle filter scheme to be applied to the Ensemble.

Note

The ParticleFilter is controlled by the Ensemble and thus has no time reference itself. No DA method should need to know where in time it is (for now). Currently assumed 1D grid.

Parameters:

N (int) – Size of ensemble, passed down from DA.Ensemble().

hyperparameters

Combination of many different parameters: like_sigma_weights (float): scale/sigma of logpdf when generating particle weights

like_sigma_state_vector (float): scale/sigma of noise added to each value in state vector

f_n_particles (float): factor between 0 and 1 which sets the threshold for when to resample.

if N_eff < f_n_particles * N then resample

Type:

dict

obs

observation value of the current model timestep, set in due course thus optional

Type:

float

state_vectors

state vector per ensemble member [N x len(z)]

Type:

np.ndarray

predictions

contains prior modeled values per ensemble member [N x 1]

Type:

np.ndarray

new_state_vectors

updated state vector per ensemble member [N x len(z)]

Type:

np.ndarray

weights

contains weights per ensemble member per prior modeled values [N x 1]

Type:

np.ndarray

resample_indices

contains indices of particles that are resampled [N x 1]

Type:

np.ndarray

All are None by default

N: int
hyperparameters: dict
obs: float | Any | None
state_vectors: Any | None
predictions: Any | None
new_state_vectors: Any | None
weights: Any | None
resample_indices: Any | None
resample: bool = False
N_eff: float | None
update()

Takes current state vectors of ensemble and returns updated state vectors ensemble

generate_weights()

Takes the ensemble and observations and returns the posterior