pymc-devs / pymc

Bayesian Modeling and Probabilistic Programming in Python
https://docs.pymc.io/
Other
8.64k stars 1.99k forks source link

AttributeError: module 'pymc3' has no attribute 'Simulator' #3366

Closed Adarsh-kumar closed 5 years ago

Adarsh-kumar commented 5 years ago

Description

I am trying to find parameters for the Lotka-Volterra equations using halfnormal prior for each of the parameter.Here's the code-

with pm.Model() as model:
    a = pm.HalfNormal('a', 1, transform=None)
    b = pm.HalfNormal('b', 0.5, transform=None)
    c = pm.HalfNormal('c', 1.5, transform=None)
    d = pm.HalfNormal('d', 1, transform=None)
    simulator = pm.Simulator('simulator', simulate, observed=observed)
    trace = pm.sample(step=pm.SMC_ABC(n_steps=50, min_epsilon=70, iqr_scale=3), 
                      draws=500)

Error.

AttributeError                            Traceback (most recent call last)
<ipython-input-12-a5645d6f5991> in <module>
     55     c = pm.HalfNormal('c', 1.5, transform=None)
     56     d = pm.HalfNormal('d', 1, transform=None)
---> 57     simulator =pm.Simulator('simulator', simulate, observed=observed)
     58     trace = pm.sample(step=pm.SMC_ABC(n_steps=50, min_epsilon=70, iqr_scale=3),
     59                       draws=50)

AttributeError: module 'pymc3' has no attribute 'Simulator'

Additional information below. The versions of different installed packages is written below.

Versions and main components

lucianopaz commented 5 years ago

Simulator is not a pymc3 distribution, and is not part of the pymc3 module's namespace, that is why you get the AttributeError. I'll close this issue as it is not a pymc3 problem. It's better to ask these kind of questions on our discourse channel

Adarsh-kumar commented 5 years ago

Thanks , I have asked the same on the discourse channel.