UvMixture
UvMixture()Weighted mixture of one or more univariate component distributions.
Attributes
| Name | Description |
|---|---|
| mean | Weighted expected value of the component distributions. |
| support | Union of component supports. |
| variance | Mixture variance using the law of total variance. |
| x_range | Union of component plotting ranges. |
Methods
| Name | Description |
|---|---|
| cdf | Weighted component cumulative distribution function. |
| elicit | Elicit a mixture directly from component distributions and weights. |
| fit | Fit is not implemented for generic univariate mixtures. |
| Weighted component probability density/mass function. | |
| plot | Plot the mixture CDF with a low-alpha PDF/PMF fill. |
| ppf | Percent point function / inverse CDF is not implemented for mixtures. |
| sample | Generate samples by first choosing a component, then sampling from it. |
| validate_mixture | Validate component and weight shapes, then normalize weights. |
cdf
UvMixture.cdf(x)Weighted component cumulative distribution function.
elicit
UvMixture.elicit(components, weights, name=None)Elicit a mixture directly from component distributions and weights.
fit
UvMixture.fit(data, **kwargs)Fit is not implemented for generic univariate mixtures.
UvMixture.pdf(x)Weighted component probability density/mass function.
plot
UvMixture.plot(
ax=None,
*,
n=500,
show=False,
cdf_kwargs=None,
pdf_kwargs=None,
percentile_guides=True,
percentiles=DEFAULT_PERCENTILES,
percentile_guide_kwargs=None,
**kwargs,
)Plot the mixture CDF with a low-alpha PDF/PMF fill.
ppf
UvMixture.ppf(q)Percent point function / inverse CDF is not implemented for mixtures.
sample
UvMixture.sample(size=1, *, seed=None)Generate samples by first choosing a component, then sampling from it.
validate_mixture
UvMixture.validate_mixture()Validate component and weight shapes, then normalize weights.