chaospy.MvStudentT

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

Multivariate Student-T Distribution.

Args:
df (float, Distribution):

Degree of freedom

mu (numpy.ndarray, Distribution):

Location parameter

sigma (numpy.ndarray):

Covariance matrix.

Examples:
>>> distribution = chaospy.MvStudentT(40, [1, 2], [[1, 0.6], [0.6, 1]])
>>> distribution
MvStudentT(df=40, mu=[1, 2], sigma=[[1, 0.6], [0.6, 1]])
>>> chaospy.Cov(distribution).round(4)
array([[1.0526, 0.6316],
       [0.6316, 1.0526]])
>>> mesh = numpy.mgrid[0.25:0.75:3j, 0.25:0.75:2j].reshape(2, -1)
>>> mesh.round(4)
array([[0.25, 0.25, 0.5 , 0.5 , 0.75, 0.75],
       [0.25, 0.75, 0.25, 0.75, 0.25, 0.75]])
>>> inverse_map = distribution.inv(mesh)
>>> inverse_map.round(4)
array([[0.3193, 0.3193, 1.    , 1.    , 1.6807, 1.6807],
       [1.0471, 2.1361, 1.4555, 2.5445, 1.8639, 2.9529]])
>>> numpy.allclose(distribution.fwd(inverse_map), mesh)
True
>>> distribution.pdf(inverse_map).round(4)
array([0.1225, 0.1225, 0.1552, 0.1552, 0.1225, 0.1225])
>>> distribution.sample(4).round(4)
array([[ 1.3979, -0.2189,  2.6868,  0.9551],
       [ 3.1625,  0.6234,  1.582 ,  1.7631]])
__init__(df, mu, sigma=None, 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.