mlmc.estimator.Estimate

class mlmc.estimator.Estimate(quantity, sample_storage, moments_fn=None)[source]

A wrapper class for moment estimation, PDF approximation, and related MLMC post-processing.

Provides utility methods to:
  • Estimate statistical moments, variances, and covariances

  • Perform regression-based variance estimation

  • Conduct bootstrap resampling

  • Construct approximate probability density functions

  • Visualize and analyze MLMC variance and sample distributions

__init__(quantity, sample_storage, moments_fn=None)[source]

Initialize the Estimate instance.

Parameters:
  • quantity – mlmc.quantity.Quantity Quantity object representing the stochastic quantity of interest.

  • sample_storage – mlmc.sample_storage.SampleStorage Storage containing MLMC samples for each level.

  • moments_fn – callable, optional Function defining the statistical moments to be estimated.

Methods

__init__(quantity, sample_storage[, moments_fn])

Initialize the Estimate instance.

bs_target_var_n_estimated(target_var[, ...])

Estimate the number of samples required to achieve a target variance.

construct_density([tol, reg_param, ...])

Construct an approximate probability density function using orthogonal moments.

est_bootstrap([n_subsamples, sample_vector, ...])

Perform bootstrap resampling to estimate uncertainty in MLMC estimators.

estimate_covariance([moments_fn])

Estimate the covariance matrix and its variance from MLMC samples.

estimate_diff_vars([moments_fn])

Estimate the variance of moment differences between consecutive MLMC levels.

estimate_diff_vars_regression(n_created_samples)

Estimate variances using a linear regression model.

estimate_domain(quantity, sample_storage[, ...])

Estimate lower and upper bounds of the domain from MLMC samples.

estimate_moments([moments_fn])

Estimate the mean and variance of the defined moment functions.

fine_coarse_violinplot()

Create violin plots comparing fine and coarse samples across levels.

get_level_samples(level_id[, n_samples])

Retrieve MLMC samples for a given level.

kurtosis_check([quantity])

Compute and return the kurtosis of the given or stored quantity.

plot_bs_var_log([sample_vec])

Generate log-scale bootstrap variance plots and variance regression fits.

plot_variances([sample_vec])

Plot variance breakdown from bootstrap and regression data.

Attributes

moments_mean_obj

Return the most recently computed mean of the moments.

n_moments

Return the number of moment functions defined.

quantity

Return the current Quantity object.