chaospy.MvLogNormal

class chaospy.MvLogNormal(mu, sigma, rotation=None)[source]

Multivariate Log-Normal Distribution.

Args:
loc (float, Distribution):

Mean vector

scale (float, Distribution):

Covariance matrix or variance vector if scale is a 1-d vector.

Examples:
>>> distribution = chaospy.MvLogNormal([1, 2], [[1, 0.6], [0.6, 1]])
>>> distribution
MvLogNormal([1, 2], [[1, 0.6], [0.6, 1]])
>>> mesh = numpy.meshgrid(*[numpy.linspace(0, 1, 5)[1:-1]]*2)
>>> distribution.inv(mesh).round(4)
array([[[ 1.3847,  2.7183,  5.3361],
        [ 1.3847,  2.7183,  5.3361],
        [ 1.3847,  2.7183,  5.3361]],

       [[ 2.874 ,  4.3077,  6.4566],
        [ 4.9298,  7.3891, 11.075 ],
        [ 8.4562, 12.6745, 18.9971]]])
>>> distribution.fwd(distribution.inv(mesh)).round(4)
array([[[0.25, 0.5 , 0.75],
        [0.25, 0.5 , 0.75],
        [0.25, 0.5 , 0.75]],

       [[0.25, 0.25, 0.25],
        [0.5 , 0.5 , 0.5 ],
        [0.75, 0.75, 0.75]]])
>>> distribution.pdf(distribution.inv(mesh)).round(4)
array([[0.0108, 0.002 , 0.    ],
       [0.0135, 0.0035, 0.    ],
       [0.0107, 0.0038, 0.0001]])
>>> distribution.sample(4).round(4)
array([[ 4.0351,  0.8185, 14.1201,  2.5996],
       [23.279 ,  1.8986,  4.9261,  5.8399]])
>>> distribution.mom((1, 2)).round(4)
6002.9122
__init__(mu, sigma, rotation=None)[source]

Distribution initializer.

In addition to assigning some object variables, also checks for some consistency issues.

Args:
parameters (Optional[Distribution[str, Union[ndarray, Distribution]]]):

Collection of model parameters.

dependencies (Optional[Sequence[Set[int]]]):

Dependency identifiers. One collection for each dimension.

rotation (Optional[Sequence[int]]):

The order of which to resolve dependencies.

exclusion (Optional[Sequence[int]]):

Distributions that has been “taken out of play” and therefore can not be reused other places in the dependency hierarchy.

repr_args (Optional[Sequence[str]]):

Positional arguments to place in the object string representation. The repr output will then be: <class name>(<arg1>, <arg2>, …).

Raises:
StochasticallyDependentError:

For dependency structures that can not later be rectified. This include under-defined distributions, and inclusion of distributions that should be exclusion.

Methods

pdf(x_data[, decompose, allow_approx, step_size])

Probability density function.

cdf(x_data)

Cumulative distribution function.

fwd(x_data)

Forward Rosenblatt transformation.

inv(q_data[, max_iterations, tollerance])

Inverse Rosenblatt transformation.

sample([size, rule, antithetic, ...])

Create pseudo-random generated samples.

mom(K[, allow_approx])

Raw statistical moments.

ttr(kloc)

Three terms relation's coefficient generator.

Attributes

interpret_as_integer

Flag indicating that return value from the methods sample, and inv should be interpreted as integers instead of floating point.

lower

Lower bound for the distribution.

stochastic_dependent

True if distribution contains stochastically dependent components.

upper

Upper bound for the distribution.