2.2.5. Introducing the TStochasticAttribute classes

The TStochasticAttribute is the parent class to all attributes which values can be generated by a TSampler (as discussed in The Stochastic methods). All child objects are random variables, following a specific law, that depends on a small number of parameters.

As from version 4.8 of the Uranie platform it is possible to combine different probability law, as a sum of weighted contributions, in order to create a new law. This approach, which is further discussed and illustrated in Composing law, leads to a new probability density function that would look like

\[f(x) = \sum_{j=1}^{N} \omega_j f_j(x)\;\; {\rm where} \;\; \forall j \in [1, N], \;\; \omega_j \in \mathbb{R}^{+}.\]

These distributions can be used to model the behaviour of variables, depending on chosen hypothesis, probability density function being used as a reference more oftenly by physicist, whereas statistical experts will generally use the cumulative distribution function [App13].

Table 2.1 gathers the list of implemented statistical laws, along with its class name in Uranie and the list of parameters used to define them. For every possible law, a piece of code is provided to show how to draw a simple PDF, along with a figure that displays the PDF, CDF and inverse CDF[1] for different sets of parameters (the equation of the corresponding PDF is reminded as well on every figure). The inverse CDF is basically the CDF whose x and y-axis are inverted (it is convenient to keep in mind what it looks like, as it will be used to produce design-of-experiments, later-on).

Table 2.1 List of Uranie classes representing the probability laws

Law

Class Uranie

Parameter 1

Parameter 2

Parameter 3

Parameter 4

Uniform

TUniformDistribution

Min

Max

Log-Uniform

TLogUniformDistribution

Min

Max

Triangular

TTriangularDistribution

Min

Max

Mode

Log-Triangular

TLogTriangularDistribution

Min

Max

Mode

Normal (Gauss)

TNormalDistribution

Mean (\(\mu\))

Sigma (\(\sigma\))

Log-Normal

TLogNormalDistribution

Mean (\(M\))

Error factor (\(E_f\))

Min

Trapezium

TTrapeziumDistribution

Min

Max

Low

Up

UniformByParts

TUniformByPartsDistribution

Min

Max

Median

Exponential

TExponentialDistribution

Rate (\(\lambda\))

Min

Cauchy

TCauchyDistribution

Scale (\(\gamma\))

Median

GumbelMax

TGumbelMaxDistribution

Mode (\(\mu\))

Scale (\(\beta\))

Weibull

TWeibullDistribution

Scale (\(\lambda\))

Shape (\(k\))

Min

Beta

TBetaDistribution

alpha (\(\alpha\))

beta (\(\beta\))

Min

Max

GenPareto

TGenParetoDistribution

Location (\(\mu\))

Scale (\(\sigma\))

Shape (\(\xi\))

Gamma

TGammaDistribution

Shape (\(\alpha\))

Scale (\(\beta\))

Location (\(\xi\))

InvGamma

TInvGammaDistribution

Shape (\(\alpha\))

Scale (\(\beta\))

Location (\(\xi\))

Student

TStudentDistribution

DoF (\(k\))

GeneralizedNormal

TGeneralizedNormalDistribution

Location (\(\mu\))

Scale (\(\alpha\))

Shape (\(\beta\))

For all these laws, the parameters can be set at the constructor (as shown in the previous example block) but, if this has not been done it is possible to change their value using the setParameters method.

To define a random variable, the corresponding constructor must be used. The arguments of these constructors are first, the name of the variable and second, the parameters of the law. For example:

    // Uniform law
    TUniformDistribution *pxu = new TUniformDistribution("x1", -1.0 , 1.0); // (1)
    // Gaussian Law
    TNormalDistribution *pxn = new TNormalDistribution("x2", -1.0 , 1.0); // (2)

  1. Allocation of a pointer pxu to a random uniform variable x1 in interval [-1.0, 1.0].

  2. Allocation of a pointer pxn to a random normal variable x2 with mean value \(\mu=-1.0\) and standard deviation \(\sigma=1.0\).

These distributions can be used to model the behaviour of inputs, the choice being generally based on the way the PDF looks like. For every distributions implemented in Uranie examples of PDF, CDF and inverse CDF are show from Uniform Law until InvGamma law. Here is a brief description of the probability density functions and their parameters.