We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following snipet and error uses v4:
v4
import numpy as np import pandas as pd import pymc3 as pm from aesara import tensor as at old_faithful_df = pd.read_csv(pm.get_data("old_faithful.csv")) waiting_times = old_faithful_df["waiting"] waiting_times = ((waiting_times - waiting_times.mean())/waiting_times.std()).values def stick_breaking(betas): ''' betas is a K-vector of iid draws from a Beta distribution ''' sticks = tt.concatenate( [ [1], (1 - betas[:-1]) ] ) return tt.mul(betas, tt.cumprod(sticks)) with pm.Model() as model: alpha = pm.Gamma(name="alpha", alpha=1, beta=1) v = pm.Beta(name="v", alpha=1, beta=alpha, shape=(K,)) # beta=alpha kinda confusing here w = pm.Deterministic(name="w", var=stick_breaking(v)) mu = pm.Normal(name="mu", mu=0, sigma=5) sigma = pm.InverseGamma(name="sigma", alpha=1, beta=1, shape=(K,)) obs = pm.NormalMixture(name="theta", w=w, mu=mu, tau=1/sigma, observed=waiting_times)
yields
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-8-9959a48ef76f> in <module> 6 mu = pm.Normal(name="mu", mu=0, sigma=5) 7 sigma = pm.InverseGamma(name="sigma", alpha=1, beta=1, shape=(K,)) ----> 8 obs = pm.NormalMixture(name="theta", w=w, mu=mu, tau=1/sigma, observed=waiting_times) ~/anaconda3/envs/pymc3-dev-py39/lib/python3.9/site-packages/pymc3/distributions/distribution.py in __new__(cls, name, rng, dims, initval, observed, total_size, transform, *args, **kwargs) 205 # Create the RV without specifying initval, because the initval may have a shape 206 # that only matches after replicating with a size implied by dims (see below). --> 207 rv_out = cls.dist(*args, rng=rng, initval=None, **kwargs) 208 ndim_actual = rv_out.ndim 209 resize_shape = None TypeError: dist() missing 1 required positional argument: 'dist_params' --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-8-9959a48ef76f> in <module> 6 mu = pm.Normal(name="mu", mu=0, sigma=5) 7 sigma = pm.InverseGamma(name="sigma", alpha=1, beta=1, shape=(K,)) ----> 8 obs = pm.NormalMixture(name="theta", w=w, mu=mu, tau=1/sigma, observed=waiting_times) ~/anaconda3/envs/pymc3-dev-py39/lib/python3.9/site-packages/pymc3/distributions/distribution.py in __new__(cls, name, rng, dims, initval, observed, total_size, transform, *args, **kwargs) 205 # Create the RV without specifying initval, because the initval may have a shape 206 # that only matches after replicating with a size implied by dims (see below). --> 207 rv_out = cls.dist(*args, rng=rng, initval=None, **kwargs) 208 ndim_actual = rv_out.ndim 209 resize_shape = None TypeError: dist() missing 1 required positional argument: 'dist_params'
However, when using v3.11.2, my model works fine. Is this because we have yet to port Mixture distributions in v4? (Similar to issue 4642?)
v3.11.2
The text was updated successfully, but these errors were encountered:
Yes it hasn't been refactored yet
Sorry, something went wrong.
ricardoV94
Successfully merging a pull request may close this issue.
The following snipet and error uses
v4
:yields
However, when using
v3.11.2
, my model works fine. Is this because we have yet to port Mixture distributions inv4
? (Similar to issue 4642?)The text was updated successfully, but these errors were encountered: