A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.pymc.io/projects/docs/en/stable/api/distributions/generated/pymc.NormalMixture.html below:

pymc.NormalMixture — PyMC 5.25.1 documentation

pymc.NormalMixture#
class pymc.NormalMixture(name, w, mu, sigma=None, tau=None, **kwargs)[source]#

Normal mixture distribution.

\[f(x \mid w, \mu, \sigma^2) = \sum_{i = 1}^n w_i N(x \mid \mu_i, \sigma^2_i)\]

Parameters:
wtensor_like of float

w >= 0 and w <= 1 the mixture weights

mutensor_like of float

the component means

sigmatensor_like of float

the component standard deviations

tautensor_like of float

the component precisions

Notes

You only have to pass in sigma or tau, but not both.

Examples

n_components = 3

with pm.Model() as gauss_mix:
    μ = pm.Normal(
        "μ",
        mu=data.mean(),
        sigma=10,
        shape=n_components,
        transform=pm.distributions.transforms.ordered,
        initval=[1, 2, 3],
    )
    σ = pm.HalfNormal("σ", sigma=10, shape=n_components)
    weights = pm.Dirichlet("w", np.ones(n_components))

    y = pm.NormalMixture("y", w=weights, mu=μ, sigma=σ, observed=data)

Methods


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4