class pymc.Mixture(name, *args, rng=None, dims=None, initval=None, observed=None, total_size=None, transform=UNSET, **kwargs)
変数
w
浮動小数点のtensor_like
0 <= w <= 1
comp_dist
dist() APIで分布を作ります。
(使用例)
# Mixture of 2 Poisson variables
with pm.Model() as model:
w = pm.Dirichlet('w', a=np.array([1, 1])) # 2 mixture weights
lam1 = pm.Exponential('lam1', lam=1)
lam2 = pm.Exponential('lam2', lam=1)
# As we just need the logp, rather than add a RV to the model, we need to call `.dist()`
# These two forms are equivalent, but the second benefits from vectorization
components = [
pm.Poisson.dist(mu=lam1),
pm.Poisson.dist(mu=lam2),
]
# `shape=(2,)` indicates 2 mixture components
components = pm.Poisson.dist(mu=pm.math.stack([lam1, lam2]), shape=(2,))
like = pm.Mixture('like', w=w, comp_dists=components, observed=data)
メソッド
Mixture.__init__(*args,**kwargs)
Mixture.dist(w, comp_dists,**kwargs)
c/s分布に一致したテンソル変数を生成する。
Mixture.rv_op(weights,*components[,size])
pymc.NormalMixture
正規混合対数尤度
class pymc.NormalMixture(name, w, mu, sigma=None, tau=None, comp_shape=(), **kwargs)