Last active
July 14, 2017 12:53
-
-
Save AustinRochford/62c283a3f0fae90b5e39 to your computer and use it in GitHub Desktop.
Density Estimation with Dirichlet Process Mixtures using PyMC3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks to this great post. I find that
ElemwiseCategoricalStep
doesn't exist inpymc3
any more, so I replace it withElemwiseCategorical
, and keep everything else the same as in the post, but I failed to obatin the expected result inestimate the density of waiting times between eruptions
. The result of the estimated density looks like a single modal gaussian.EDIT:
I find the reason, there are some typos in the post:
1. / np.sqrt(trace['lambda'] * trace['tau'])[:, np.newaxis, :])
should be(trace['lambda'] * trace['tau'])[:, np.newaxis, :]
, there should be no inverse and square root.estimate the density of sunspots per year
, multiple occurance oftrace['beta']
should betrace['w']
and In [30]:w = pm.Deterministic('beta', beta * T.concatenate([[1], T.extra_ops.cumprod(1 - beta[:-1])]))
should bew = pm.Deterministic('w', beta * T.concatenate([[1], T.extra_ops.cumprod(1 - beta[:-1])]))
I don't understand why in the second case, reassign
beta
variable does not raise an error in pymc3.