Thanks! I tried running the worked out example for Gaussian mixture model and encountered this error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Input In [25], in <cell line: 1>()
10 σ = pm.HalfNormal("σ", sigma=1, dims="cluster")
11 weights = pm.Dirichlet("w", np.ones(k), dims="cluster")
---> 12 pm.NormalMixture("x", w=weights, mu=μ, sigma=σ, observed=x)
File ~/anaconda3/lib/python3.9/site-packages/pymc/distributions/distribution.py:267, in Distribution.__new__(cls, name, rng, dims, initval, observed, total_size, transform, *args, **kwargs)
263 rng = model.next_rng()
265 # Create the RV and process dims and observed to determine
266 # a shape by which the created RV may need to be resized.
--> 267 rv_out, dims, observed, resize_shape = _make_rv_and_resize_shape(
268 cls=cls, dims=dims, model=model, observed=observed, args=args, rng=rng, **kwargs
269 )
271 if resize_shape:
272 # A batch size was specified through `dims`, or implied by `observed`.
273 rv_out = change_rv_size(rv_var=rv_out, new_size=resize_shape, expand=True)
File ~/anaconda3/lib/python3.9/site-packages/pymc/distributions/distribution.py:166, in _make_rv_and_resize_shape(cls, dims, model, observed, args, **kwargs)
163 """Creates the RV and processes dims or observed to determine a resize shape."""
164 # Create the RV without dims information, because that's not something tracked at the Aesara level.
165 # If necessary we'll later replicate to a different size implied by already known dims.
--> 166 rv_out = cls.dist(*args, **kwargs)
167 ndim_actual = rv_out.ndim
168 resize_shape = None
TypeError: dist() missing 1 required positional argument: 'dist_params'
I am using PyMC version 4