chaospy.Distribution.mom

Distribution.mom(K, allow_approx=True, **kwargs)[source]

Raw statistical moments.

Creates non-centralized raw moments from the random variable. If analytical options can not be utilized, Monte Carlo integration will be used.

Args:
K (numpy.ndarray):

Index of the raw moments. k.shape must be compatible with distribution shape. Sampling scheme when performing Monte Carlo

allow_approx (bool):

Allow the moments to be calculated using quadrature integration if analytical approach fails. Raises error instead if false.

kwargs (Any):

Arguments passed to chaospy.approximate_moment() if approximation is used.

Raises:
chaospy.UnsupportedFeature:

If analytical calculation is not possible and allow_approx is false.

Returns:
(numpy.ndarray):

Shapes are related through the identity k.shape == dist.shape+k.shape.