get_rsquared_acv¶
-
pyapprox.control_variate_monte_carlo.
get_rsquared_acv
(cov, nsample_ratios, get_discrepancy_covariances)[source]¶ Compute r^2 used to compute the variance reduction of Approximate Control Variate Algorithms
- 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]
- 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
- get_discrepancy_covariancescallable
Function that returns the covariances of the control variate discrepancies. Functions must have the signature CF,cf = get_discrepancy_covariances(cov,nsample_ratios)
- Returns
- rsquaredfloat
The value r^2