gemseo_umdo / statistics / multilevel

Hide inherited members

pilot module

The base pilot for multilevel algorithms.

class gemseo_umdo.statistics.multilevel.pilot.Pilot(sampling_ratios, costs)[source]

Bases: object

The base pilot for multilevel algorithms.

A pilot is associated with a statistic, e.g. mean. The method [compute_next_level_and_statistic()][gemseo_umdo.statistics.multilevel.pilot.Pilot.compute_next_level_and_statistic] returns a multilevel estimation of the statistic based on the current samples and the next level $ell^*$ of the telescopic sum to sample in order to improve this estimation.

This level $ell^*$ maximizes the criterion

$$frac{mathcal{V}_ell} {r_ell n_ell^2(mathcal{C}_ell+mathcal{C}_{ell-1})}$$

where $mathcal{C}_{ell}$ is the unit evaluation cost of the model $f_ell$ (with $mathcal{C}_{-1}=0$), $n_ell$ is the current number of evaluations of $f_ell$ and $r_ell$ is the factor by which $n_ell$ would be increased by choosing the level $ell$. Regarding $mathcal{V}_ell$, it represents the variance of the $ell$-th term of the telescopic sum characteristic of the MLMC techniques. For instance, $mathcal{V}_ell=mathbb{E}[Y_ell-Y_{ell}]$ in the case of the expectation.

See also

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

Parameters:
  • sampling_ratios (NDArray[float]) – The sampling ratios $r_0,ldots,r_L$; the sampling ratio $r_ell$ is the factor by which $n_ell$ is increased between two sampling steps on the level $ell$.

  • costs (NDArray[float]) – The unit sampling costs of each level of the telescopic sum. Namely, $(mathcal{C}_{ell-1}+mathcal{C}_ell)_{ellin{0,ldots,L}}$ with $mathcal{C}_{-1}=0$.

compute_next_level_and_statistic(levels, total_n_samples, samples, *pilot_parameters)[source]

Compute the next level $ell^*$ to sample and estimate the statistic.

Parameters:
  • levels (Iterable[int]) – The levels that have just been sampled.

  • total_n_samples (ndarray[Any, dtype[int]]) – The total number of samples of each level.

  • samples (Sequence[ndarray[Any, dtype[float]]]) – The samples of the different quantities of each level.

  • *pilot_parameters (Any) – The parameters of the pilot.

Returns:

The next level $ell^*$ to sample and an estimation of the statistic.

Return type:

tuple[int, numpy.ndarray[Any, numpy.dtype[float]]]

V_l: ndarray[Any, dtype[float]]

The terms variances $mathcal{V}_0,ldots,mathcal{V}_L$.