pyrtid.inverse.executors.ESMDASolverConfig#
- class pyrtid.inverse.executors.ESMDASolverConfig(hm_end_time: Optional[float] = None, is_parallel: bool = False, max_workers: int = 2, random_state: Optional[Union[int, np.random.Generator, np.random.RandomState]] = Generator(PCG64) at 0x743B77D6B5A0, is_fwd_verbose: bool = False, is_save_spmats: bool = False, is_check_jacvec: bool = False, is_use_fsm: bool = True, n_assimilations: int = 4, cov_obs_inflation_factors: Optional[Sequence[float]] = None, inversion_type: ESMDAInversionType = ESMDAInversionType.SUBSPACE_RESCALED, cov_ss_inflation_factor: float = 1.0, C_DD_localization: LocalizationStrategy = <pyesmda.localization.NoLocalization object>, C_SD_localization: LocalizationStrategy = <pyesmda.localization.NoLocalization object>, save_ensembles_history: bool = False, is_forecast_for_last_assimilation: bool = True, batch_size: int = 5000, is_parallel_analyse_step: bool = True, truncation: float = 0.99, logger: Optional[logging.Logger] = <Logger ESMDA (WARNING)>)[source]#
Bases:
FSMSolverConfigEnsemble Smoother with Multiple Data Assimilation Inversion Configuration.
- Attributes
hm_end_time (Optional[float]) – Time at which the history matching ends and the forecast begins. This is not to confuse with the simulation duration which is already defined by the user in the htc file. The units are the same as given for the duration keyword in HYTEC. If None, hm_end_time is set to the end of the simulation and all observations covering the simulation duration are taken into account. The default is None.
is_parallel (bool, optional) – Whether to run the calculation one at the time or in a concurrent way.
max_workers (int, optional) – Number of workers to use if the concurrency is enabled. The default is 2.
random_state (Optional[Union[int, np.random.Generator, np.random.RandomState]]) – Pseudorandom number generator state used to generate resamples. If random_state is
None(or np.random), the numpy.random.RandomState singleton is used. If random_state is an int, a newRandomStateinstance is used, seeded with random_state. If random_state is already aGeneratororRandomStateinstance then that instance is used.is_fwd_verbose (bool) – Whether to solve the forward problem displaying all information. By default False.
is_save_sp_mats (bool) – Whether to save all the stiffness matrices from flow and transport. This is mostly useful to check the adjoint state correctness and devs. The default is False. is_check_jacvec: bool Whether the products between the jacobian and the rhs vectors computed by the FSM are checked by finite difference. The default is False.
is_use_fsm (bool) – Whether to use the the FSM for the jacobian dot products with the rhs vectors. The default is True.
n_assimilations : int, optional Number of data assimilations (\(N_{a}\)). The default is 4.
cov_obs_inflation_factors (Optional[Sequence[float]]) – Multiplication factor used to inflate the covariance matrix of the measurement errors. Must match the number of data assimilations (\(N_{a}\)). The default is None.
inversion_type (ESMDAInversionType) – Type of inversion used to solve \((C_DD + \alpha CD)^{-1)(d-dobs)\). TODO: check the docstrings + add a comment about the best method for large scale problems. Maybe add a reference to the class + update the docs interpshinx. + Add to ESMDARS. The default is ESMDAInversionType.NAIVE.
cov_ss_inflation_factor (float) – Factor used to inflate the initial ensemble around its mean. See [Anderson, 2007]. The default is 1.0 i.e., no inflation.
C_DD_localization (LocalizationStrategy) – Localization operator \(\rho_{DD}\) applied to the predictions empirical auto-covariance matrices. Expected dimensions of the operator are (\(N_{obs}\), \(N_{obs}\)). It can be fixed (defined correlation matrix used for all iterations) or adaptive and even user defined. See implementations of
LocalizationStrategy.C_SD_localization (LocalizationStrategy) – Localization operator \(\rho_{DD}\) applied to the parameters-predictions empirical corss-covariance matrices. Expected dimensions of the operator are (\(N_{m}\), \(N_{obs}\)). It can be fixed (defined correlation matrix used for all iterations) or adaptive and even user defined. See implementations of
LocalizationStrategy.save_ensembles_history (bool, optional) – Whether to save the history predictions and parameters over the assimilations. The default is False.
is_forecast_for_last_assimilation (bool, optional) – Whether to compute the predictions for the ensemble obtained at the last assimilation step. The default is True.
batch_size (int) – Number of parameters that are assimilated at once. This option is available to overcome memory limitations when the number of parameters is large. In that case, the size of the covariance matrices tends to explode and the update step must be performed by chunks of parameters. The default is 5000.
is_parallel_analyse_step (bool, optional) – Whether to use parallel computing for the analyse step if the number of batch is above one. It relies on concurrent.futures multiprocessing. The default is True.
truncation (float) – A value in the range ]0, 1], used to determine the number of significant singular values kept when using svd for the inversion of \((C_{dd} + \alpha C_{d})\): Only the largest singular values are kept, corresponding to this fraction of the sum of the nonzero singular values. The goal of truncation is to deal with smaller matrices (dimensionality reduction), easier to inverse. The default is 0.99.
logger (Optional[logging.Logger]) – Optional
logging.Loggerinstance used for event logging. The default is None.
- __init__(hm_end_time: Optional[float] = None, is_parallel: bool = False, max_workers: int = 2, random_state: Optional[Union[int, np.random.Generator, np.random.RandomState]] = Generator(PCG64) at 0x743B77D6B5A0, is_fwd_verbose: bool = False, is_save_spmats: bool = False, is_check_jacvec: bool = False, is_use_fsm: bool = True, n_assimilations: int = 4, cov_obs_inflation_factors: Optional[Sequence[float]] = None, inversion_type: ESMDAInversionType = ESMDAInversionType.SUBSPACE_RESCALED, cov_ss_inflation_factor: float = 1.0, C_DD_localization: LocalizationStrategy = <pyesmda.localization.NoLocalization object>, C_SD_localization: LocalizationStrategy = <pyesmda.localization.NoLocalization object>, save_ensembles_history: bool = False, is_forecast_for_last_assimilation: bool = True, batch_size: int = 5000, is_parallel_analyse_step: bool = True, truncation: float = 0.99, logger: Optional[logging.Logger] = <Logger ESMDA (WARNING)>) None#
Methods definition