chaospy.Pareto2¶
- class chaospy.Pareto2(shape=1, scale=1, shift=0)[source]¶
Pareto type 2 distribution.
Also known as Lomax distribution (for loc=0).
Lower threshold at loc and survival: (1+x)^-shape.
- Args:
- shape (float, Distribution):
Shape parameter
- scale (float, Distribution):
Scaling parameter
- loc (float, Distribution):
Location parameter
- Examples:
>>> distribution = chaospy.Pareto2(15) >>> distribution Pareto2(15) >>> uloc = numpy.linspace(0, 1, 6) >>> uloc array([0. , 0.2, 0.4, 0.6, 0.8, 1. ]) >>> xloc = distribution.inv(uloc) >>> xloc.round(3) array([0. , 0.015, 0.035, 0.063, 0.113, 5.31 ]) >>> numpy.allclose(distribution.fwd(xloc), uloc) True >>> distribution.pdf(xloc).round(3) array([15. , 11.823, 8.699, 5.644, 2.695, 0. ]) >>> distribution.sample(4).round(3) array([0.073, 0.008, 0.222, 0.045])
- __init__(shape=1, scale=1, shift=0)[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
Flag indicating that return value from the methods sample, and inv should be interpreted as integers instead of floating point.
Lower bound for the distribution.
True if distribution contains stochastically dependent components.
Upper bound for the distribution.