pystra.model.StochasticModel#

class StochasticModel[source]#

Bases: object

Stochastic model

Attributes can be accessed via properties or the legacy getter methods:

model.constants          # preferred
model.getConstants()     # legacy, equivalent

Use ordered dictionary to make sure that the order corresponds to the correlation matrix

Methods

addCallFunction

addVariable

Add a random variable or constant to the model.

getCallFunction

getConstants

getCorrelation

getLenMarginalDistributions

getMarginalDistributions

getModifiedCorrelation

getNames

getVariable

getVariables

setCorrelation

setMarginalDistributions

setModifiedCorrelation

addVariable(obj)[source]#

Add a random variable or constant to the model.

Parameters:

obj (Distribution or Constant) – The variable to add. Distributions are treated as random variables; Constants are stored separately and passed as fixed values to the limit state function.

Raises:

Exception – If obj is not a Distribution or Constant, or if a variable with the same name already exists.

property constants#

Dictionary of constant name → value pairs.

property names#

List of all variable and constant names, in insertion order.

property n_marg#

Number of marginal (stochastic) distributions.

property marginal_distributions#

List of marginal Distribution objects.

property correlation#

Correlation matrix (n × n numpy array).

property modified_correlation#

Modified (Nataf) correlation matrix Ro.

property call_function#

Cumulative number of limit-state function evaluations.