Skip to content

Chain 0 failed. #13

@vidigen

Description

@vidigen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions