Capabilities Documentation

plotting docu

probabilistic.capabilities.plotting.initiate_plot_settings()

function to initiate plotting settings

probabilistic.capabilities.plotting.plot_deterministic_parameter_value(value, variable_name)

function to plot deterministic value

Parameters:
  • value

  • variable_name

probabilistic.capabilities.plotting.plot_distribution_pdf(distribution, variable_name, plot_limits=False)

function to plot distribution pdf

Parameters:
  • distribution

  • variable_name

  • plot_limits (bool) – Defaults to False

probabilistic.capabilities.plotting.plot_sample_cdf(samples: array, variable_name: str, percentiles: list = False, **kwargs)

function to plot cdf of samples

Parameters:
  • samples (np.array) – data to be plotted

  • variable_name (str) – name of data to be plotted

  • percentiles (list) – percentiles to include on plot

  • kwargs (dict) – additional histogram function inputs

probabilistic.capabilities.plotting.plot_sample_histogram(samples: array, variable_name: str, percentiles: list = False, **kwargs)

function to plot histogram of samples

Parameters:
  • samples (np.array) – data to be plotted

  • variable_name (str) – name of data to be plotted

  • percentiles (list) – percentiles to include on plot

  • kwargs (dict) – additional histogram function inputs

probabilistic.capabilities.plotting.plot_scatter_matrix(data_dict, density=False)

function to plot scatter matrix of samples from multiple parameters

Parameters:
  • data_dict (dict) –

  • density (bool) – Defaults to False

sampling docu

class probabilistic.capabilities.sampling.BoundingStudy(number_of_aleatory_samples: int, number_of_epistemic_samples: int, random_state)

Bounding Sensitivity Study Class

Parameters:
  • number_of_aleatory_samples (int) –

  • number_of_epistemic_samples (int) –

  • random_state

add_sensitivity_samples_to_sample_sheet(aleatory_samples, epistemic_samples)

function to add samples from bounding sensitivity study to sample sheet

determine_total_sample_size()

function to determine the total sample size of the study

generate_cdf_samples(_)

function to specify percentiles sampled from cdf

relevant_error_checks()

function to perform error checks on specified study details

class probabilistic.capabilities.sampling.LHSStudy(number_of_aleatory_samples: int, number_of_epistemic_samples: int, random_state)

LHS Uncertainty Study Class

Parameters:
  • number_of_aleatory_samples (int) –

  • number_of_epistemic_samples (int) –

  • random_state

collect_variables(variable_distribution_dict, number_of_samples)

function to collect variable samples for LHS study

create_variable_sample_sheet()

function to create sample sheet for LHS study

relevant_error_checks()

function to perform error checks on specified study details

class probabilistic.capabilities.sampling.OneAtATimeSensitivityStudy(number_of_aleatory_samples: int, number_of_epistemic_samples: int, random_state)

Single Variable Sampling-Based Sensitivity Study

Parameters:
  • number_of_aleatory_samples (int) –

  • number_of_epistemic_samples (int) –

  • random_state

add_sensitivity_samples_to_sample_sheet(aleatory_samples, epistemic_samples)

function to add sensitivity study samples to sample sheet for sampling based sensitivity study

collect_variables(variable_distribution_dict, number_of_samples)

function to collect samples for uncertain variables for sampling based sensitivity study

create_variable_sample_sheet()

function to create sample sheet for sampling based sensitivity study

determine_total_sample_size()

function to determine the total sample size of the study

generate_cdf_samples(number_of_samples)

function to specify percentiles sampled from cdf

relevant_error_checks()

function to perform error checks on specified study details

class probabilistic.capabilities.sampling.RandomStudy(number_of_aleatory_samples: int, number_of_epistemic_samples: int, random_state)

Random Sampling Uncertainty Study Class

Parameters:
  • number_of_aleatory_samples (int) –

  • number_of_epistemic_samples (int) –

  • random_state

collect_variables(variable_distribution_dict, number_of_samples)

function to collect variable samples for random sampling study

create_variable_sample_sheet()

function to create sample sheet and add samples for random sampling study

relevant_error_checks()

function to perform error checks on specified study details

class probabilistic.capabilities.sampling.SensitivityStudy(number_of_aleatory_samples: int, number_of_epistemic_samples: int, random_state)

Generic Sensitivity Study Class

Parameters:
  • number_of_aleatory_samples (int) –

  • number_of_epistemic_samples (int) –

  • random_state

relevant_error_checks()

function to perform error checks on specified study details

class probabilistic.capabilities.sampling.UncertaintyStudy(number_of_aleatory_samples: int, number_of_epistemic_samples: int, random_state)

Generic Uncertainty Study Class

Parameters:
  • number_of_aleatory_samples (int) –

  • number_of_epistemic_samples (int) –

  • random_state

add_aleatory_samples_to_sample_sheet(samples)

function to add aleatory variable samples to uncertainty study sample sheet

add_deterministic_samples_to_sample_sheet(parameter, sample_size)

function to add deterministic samples to sample sheet

add_deterministic_variables(deterministic_set)

function to add deterministic variables to study

add_epistemic_samples_to_sample_sheet(samples)

function to add epistemic variable samples to uncertainty study sample sheet

add_nominal_values_to_sample_sheet(nominal_values)

function for adding nominal values to sample sheet for generic sampling study

add_probabilistic_variables(distribution_set)

function to add probabilistic variables to study

static add_variable_name(variable_distribution, location)

function to ensure two variables don’t have the same name

add_variables(input_parameters)

Function to add all uncertain variables to uncertainty study

static calc_number_of_variables(variable_dict)

function to calculate the number of variables in a dictionary

calc_total_number_of_variables()

function to determine total number of uncertain variables in uncertainty study

static collect_variable_nominal_values(variable_dict)

function to collect nominal values of variables

create_variable_nominal_sheet()

function to create sample sheet holding variables nominal values

error_check_for_distributions_and_sample_size()

function to check that both an uncertainty distribution exists and sample size has been specified, not one or the other

error_check_for_distributions_if_sample_size()

function to check that both an uncertainty distribution exists and sample size has been specified, not one or the other

error_check_for_variable_unique_variable_names()

function to check that all variables have unique names

generate_lhs_samples(number_of_variables: int, number_of_samples: int, optimization_method='random-cd')

function to generate Latin hypercube samples (LHS) using Scipy’s Quasi-Monte Carlo submodule

Parameters:
  • number_of_variables (int) – how many variables to generate samples for

  • number_of_samples (int) – how many LHS samples to generate

Returns:

  • lhs_samples (np.array(number_of_samples, number_of_variables))

  • - LHS samples

get_parameter_names()

function to both deterministic and probabilistic variable names

get_total_double_loop_sample_size()

function to get sample size for double loop style uncertainty study

get_uncertain_parameter_names()

function to determine total number of uncertain variables in study

relevant_error_checks()

function to perform error checks on specified study details

uncertainty_definitions docu

class probabilistic.capabilities.uncertainty_definitions.BetaDistribution(name: str, uncertainty_type: str, nominal_value: float, a: float, b: float, loc: float | None = None, scale: float | None = None)

Beta Distribution Uncertainty Class

Parameters:
  • name (str) –

  • uncertainty_type (str) –

  • nominal_value (float) –

  • a (float) –

  • b (float) –

  • loc (float) –

  • scale (float) –

class probabilistic.capabilities.uncertainty_definitions.DeterministicCharacterization(name: str, value: float)

Generic Deterministic Parameter Class

Parameters:
  • name (str) –

  • value (float) –

generate_samples(sample_size)

Function to generate deterministic samples (same values)

plot_distribution()

Function to create plot of uncertainty distribution

class probabilistic.capabilities.uncertainty_definitions.LognormalDistribution(name: str, uncertainty_type: str, nominal_value: float, mu: float, sigma: float)

Log-Normal Distribution Uncertainty Class

Parameters:
  • name (str) –

  • uncertainty_type (str) –

  • nominal_value (float) –

  • mu (float) –

  • sigma (float) –

class probabilistic.capabilities.uncertainty_definitions.NormalDistribution(name: str, uncertainty_type: str, nominal_value: float, mean: float, std_deviation: float)

Normal Distribution Uncertainty Class

Parameters:
  • name (str) –

  • uncertainty_type (str) –

  • nominal_value (float) –

  • mean (float) –

  • std_deviation (float) –

class probabilistic.capabilities.uncertainty_definitions.TruncatedNormalDistribution(name: str, uncertainty_type: str, nominal_value: float, mean: float, std_deviation: float, lower_bound: float, upper_bound: float)

Truncated Normal Distribution Uncertainty Class

Parameters:
  • name (str) –

  • uncertainty_type (str) –

  • nominal_value (float) –

  • mean (float) –

  • std_deviation (float) –

  • lower_bound (float) –

  • upper_bound (float) –

class probabilistic.capabilities.uncertainty_definitions.UncertaintyCharacterization(name: str, uncertainty_type: str, nominal_value: float, distribution: str, parameters: dict)

Generic Uncertainty Distribution Class

Parameters:
  • name (str) –

  • uncertainty_type (str) –

  • nominal_value (float) –

  • distribution (str) –

  • parameters (dict) –

generate_samples(sample_size: int, random_state=np.random.default_rng())

Function to sample from uncertainty distributions

Parameters:
  • sample_size (int) – number of samples

  • random_state (generator) – np default_rng instance or will be used to create randomState instance

plot_distribution(plot_limits=False)

Function to create plot of uncertainty distribution

class probabilistic.capabilities.uncertainty_definitions.UniformDistribution(name: str, uncertainty_type: str, nominal_value: float, lower_bound: float, upper_bound: float)

Uniform Distribution Uncertainty Class

Parameters:
  • name (str) –

  • uncertainty_type (str) –

  • nominal_value (float) –

  • lower_bound (float) –

  • upper_bound (float) –

probabilistic.capabilities.uncertainty_definitions.specify_distribution(parameter_specification)

function to generate specified distribution type object :param parameter_specification: dictionary containing specification of desired uncertainty distribution :type parameter_specification: dict

Returns:

dist – specified distribution type object

Return type:

UncertaintyCharacterization