punpy.mc.mc_propagation.MCPropagation

punpy.mc.mc_propagation.MCPropagation#

class punpy.mc.mc_propagation.MCPropagation(steps, parallel_cores=0, dtype=None, verbose=False, MCdimlast=True)[source]#

Class to propagate uncertainties using Monte Carlo (MC)

Parameters:
  • steps (int) – number of MC iterations

  • parallel_cores (int) – number of CPU to be used in parallel processing

  • dtype (numpy dtype) – numpy dtype for output variables

  • verbose (bool) – bool to set if logging info should be printed

  • MCdimlast (bool) – bool to set whether the MC dimension should be moved to the last dimension when running through the measurment function (when parallel_cores==0). This can be useful for broadcasting within the measurement function. defaults to False

__init__(steps, parallel_cores=0, dtype=None, verbose=False, MCdimlast=True)[source]#

Methods

__init__(steps[, parallel_cores, dtype, ...])

combine_samples(MC_samples)

Function to combine MC samples from individual runs

generate_MC_sample(x, u_x, corr_x[, ...])

function to generate MC sample for input quantities

generate_MC_sample_cov(x, cov_x[, ...])

function to generate MC sample for input quantities from covariance matrix

process_samples(MC_x, MC_y[, return_corr, ...])

Run the MC-generated samples of input quantities through the measurement function and calculate correlation matrix if required.

propagate_cov(func, x, cov_x[, param_fixed, ...])

Propagate uncertainties with given covariance matrix through measurement function with n input quantities.

propagate_cov_flattened(func, x, cov_x[, ...])

Propagate uncertainties with given covariance matrix through measurement function with n input quantities.

propagate_random(func, x, u_x[, corr_x, ...])

Propagate random uncertainties through measurement function with n input quantities.

propagate_standard(func, x, u_x, corr_x[, ...])

Propagate uncertainties through measurement function with n input quantities.

propagate_systematic(func, x, u_x[, corr_x, ...])

Propagate systematic uncertainties through measurement function with n input quantities.

run_samples(func, MC_x[, output_vars, ...])

process all the MC samples of input quantities through the measurand function