allocate_samples_mfmc¶
-
pyapprox.control_variate_monte_carlo.
allocate_samples_mfmc
(cov, costs, target_cost, standardize=True)[source]¶ Determine the samples to be allocated to each model when using MFMC
- 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
- log10_variancefloat
The base 10 logarithm of the variance of the estimator