dist_empirical
dist_empirical(x, p, p_transform='NormalZ', p_descending=False)Empirical distribution.
A distribution defined by paired value/probability points, interpolated between. Mirrors the C# EmpiricalDistribution composite.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| x | array-like of float | Values. | required |
| p | array-like of float | Associated probabilities, the same length as x. |
required |
| p_transform | ('NormalZ', 'None') | How p is interpolated between: "NormalZ" transforms through the standard-normal quantile; "None" interpolates p directly. |
"NormalZ" |
| p_descending | bool | Whether p decreases as x increases (a survival-function encoding); False is the ordinary ascending-CDF case. |
False |
Returns
| Name | Type | Description |
|---|---|---|
| Distribution | Family "Empirical", accepted by every method every other :class:Distribution accepts. |
Examples
>>> d = dist_empirical(x=[1, 2, 3], p=[0.1, 0.5, 0.9])
>>> d.quantile(0.5)
2.0