-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Dear Eric,
thanks a lot for a great post HMM in pymc3 (https://ericmjl.github.io/essays-on-data-science/machine-learning/markov-models/). I am writing a thesis in associative learning and I would like to integrate part of your model into my simulations. The problem is that when I run the sampler for
n_states = 3
with pm.Model() as model:
p_transition = pm.Dirichlet(
"p_transition",
a=tt.ones((n_states, n_states)) * 4, # weakly informative prior
shape=(n_states, n_states))
# Solve for the equilibrium state
p_equilibrium = solve_equilibrium(n_states, p_transition)
obs_states = HMMStates(
"states",
p_transition=p_transition,
p_equilibrium=p_equilibrium,
n_states=n_states,
observed=np.array(states).astype("float")
)
it gets stack saying "Chain 0 failed."
If I run prior checks I manage to get samples for the "p_transition" but for "states", I get the following error:
'HMMStates' object has no attribute 'p'
I guess the problems are related.
Those are the versions:
numpy == 1.19.1
theano == 1.0.4
pymc3 == 3.9.3
Thanks a lot in advance for your help.
Vincenzo