gemseo_umdo / statistics / multilevel / mlmc_mlcv

Show inherited members

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: MLMC

Multilevel 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.5 can 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: StrEnum

A 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:
  • level (int) – The level of the telescopic sum.

  • n_levels (int) – The number of levels.

  • variant (Variant) – The variant of the algorithm.

Returns:

The positions of the surrogate models.

Return type:

slice

See also

El Amri et al., Table 1, Multilevel Surrogate-based Control Variates, 2023.