romtools.workflows.uq.statistics#
Statistical estimators used by Monte Carlo UQ workflows.
Functions
|
Compute componentwise Monte Carlo sample statistics. |
|
Compute a componentwise two-level control-variate estimate. |
|
Compute statistics from identically ordered high/low QoI pairs. |
Classes
|
Componentwise Monte Carlo statistics. |
|
Componentwise two-level control-variate statistics. |
- class romtools.workflows.uq.statistics.MonteCarloStatistics(mean, variance, standard_deviation, standard_error)[source]#
Bases:
objectComponentwise Monte Carlo statistics.
- Parameters:
mean (ndarray)
variance (ndarray)
standard_deviation (ndarray)
standard_error (ndarray)
- class romtools.workflows.uq.statistics.MultifidelityStatistics(mean, variance, standard_error, control_variate_coefficients, paired_correlations)[source]#
Bases:
objectComponentwise two-level control-variate statistics.
- Parameters:
mean (ndarray)
variance (ndarray)
standard_error (ndarray)
control_variate_coefficients (ndarray)
paired_correlations (ndarray)
- romtools.workflows.uq.statistics.compute_monte_carlo_statistics(qoi_values)[source]#
Compute componentwise Monte Carlo sample statistics.
- Parameters:
qoi_values (ndarray) – Scalar samples with shape
(N,)or flattened vector-QoI samples with shape(N, N_qoi). At least two are required.- Returns:
Sample mean, unbiased sample variance (
ddof=1), sample standard deviation, and standard error of the mean.- Return type:
- romtools.workflows.uq.statistics.compute_multifidelity_statistics(high_fidelity_qois, low_fidelity_qois, control_variate_coefficients=None)[source]#
Compute a componentwise two-level control-variate estimate.
- Parameters:
high_fidelity_qois (ndarray) – High-fidelity samples with shape
(N_H, N_qoi)or(N_H,).low_fidelity_qois (ndarray) – Low-fidelity samples with shape
(N_L, N_qoi)or(N_L,). Its firstN_Hrows must be paired with the high-fidelity samples andN_Lmust be at leastN_H.control_variate_coefficients (ndarray | None) – Optional scalar or length-
N_qoicoefficient array. Paired samples estimate coefficients if omitted.
- Returns:
Mean estimate, estimated variance and standard error of that mean estimator, coefficients, and paired correlations.
- Return type:
- romtools.workflows.uq.statistics.compute_paired_statistics(high_qois, low_qois)[source]#
Compute statistics from identically ordered high/low QoI pairs.
Returns the high and low unbiased sample variances, covariance, control-variate coefficient
covariance / low_variance, and Pearson correlation. Components with numerically constant low-fidelity data receive zero coefficient and correlation.- Parameters:
high_qois (ndarray)
low_qois (ndarray)