allocate_samples_mlmc¶
-
pyapprox.control_variate_monte_carlo.
allocate_samples_mlmc
(cov, costs, target_cost, standardize=True)[source]¶ Determine the samples to be allocated to each model when using MLMC
- Parameters
- covnp.ndarray (nmodels,nmodels)
The covariance C between each of the models. The highest fidelity model is the first model, i.e its variance is cov[0,0]
- costsnp.ndarray (nmodels)
The relative costs of evaluating each model
- target_costfloat
The total cost budget
- standardizeboolean
If true make sure that nhf_samples is an integer and that nhf_samples*nsamples_ratios are integers. False is only ever used for testing.
- Returns
- nhf_samplesinteger
The number of samples of the high fidelity model
- nsample_ratiosnp.ndarray (nmodels-1)
The sample ratios r used to specify the number of samples of the lower fidelity models, e.g. N_i = r_i*nhf_samples, i=1,…,nmodels-1. For model i>0 nsample_ratio*nhf_samples equals the number of samples in the two different discrepancies involving the ith model.
- log10_variancefloat
The base 10 logarithm of the variance of the estimator