mlmc_mlcv module¶
Multilevel Monte Carlo with multilevel control variates (MLMC-MLCV).
- class gemseo_umdo.statistics.multilevel.mlmc_mlcv.mlmc_mlcv.MLMCMLCV(levels, uncertain_space, n_samples, pilot='Mean', variant=Variant.MLMC_MLCV, seed=0)[source]
Bases:
MLMCMultilevel Monte Carlo with multilevel control variates (MLMC-MLCV).
- Parameters:
levels (Sequence[Level]) – The levels defined in terms of model, evaluation cost and initial number of calls.
uncertain_space (ParameterSpace) – The uncertain space on which to sample the functions.
n_samples (float) – The sampling budget expressed as the number of model evaluations equivalent to evaluations of the finest model. This number is not necessarily an integer; for instance, if $f_L$ is twice as expensive as $f_{L-1}$, then
n_samples=1.5can correspond to 1 evaluation of $f_L$ and 1 evaluation of $f_{L-1}$.pilot_statistic_name – The name of the statistic used to drive the algorithm.
seed (int) –
The initial random seed for reproducibility. Then, the seed is incremented at each level of the telescopic sum and at each algorithm iteration.
By default it is set to 0.
pilot (str) –
By default it is set to “Mean”.
variant (Variant) –
By default it is set to “MLMC-MLCV”.
- Raises:
ValueError – When the minimum cost is greater than the maximum cost.
- class Variant(value)[source]
Bases:
StrEnumA variant of the MLMC-MLCV algorithm.
- MLMC_CV = 'MLMC-CV'
- MLMC_CV_0 = 'MLMC-CV[0]'
- MLMC_MLCV = 'MLMC-MLCV'
- MLMC_MLCV_0 = 'MLMC-MLCV[0]'
- classmethod get_surrogate_positions(level, n_levels, variant)[source]
Return the positions of the surrogate models for given level and variant.
These are their positions in a sequence starting to count at 0. So, the position of $g_ell$ is $ell$ for $ellin{0,ldots,L}$ while the position of $h_ell$ is $ell-1$ for $ellin{1,ldots,L}$.
- Parameters:
- Returns:
The positions of the surrogate models.
- Return type:
See also
El Amri et al., Table 1, Multilevel Surrogate-based Control Variates, 2023.