romtools.workflows.uq.statistics#

Statistical estimators used by Monte Carlo UQ workflows.

Functions

compute_monte_carlo_statistics(qoi_values)

Compute componentwise Monte Carlo sample statistics.

compute_multifidelity_statistics(...[, ...])

Compute a componentwise two-level control-variate estimate.

compute_paired_statistics(high_qois, low_qois)

Compute statistics from identically ordered high/low QoI pairs.

Classes

MonteCarloStatistics(mean, variance, ...)

Componentwise Monte Carlo statistics.

MultifidelityStatistics(mean, variance, ...)

Componentwise two-level control-variate statistics.

class romtools.workflows.uq.statistics.MonteCarloStatistics(mean, variance, standard_deviation, standard_error)[source]#

Bases: object

Componentwise 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: object

Componentwise 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:

MonteCarloStatistics

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 first N_H rows must be paired with the high-fidelity samples and N_L must be at least N_H.

  • control_variate_coefficients (ndarray | None) – Optional scalar or length-N_qoi coefficient 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:

MultifidelityStatistics

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)