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

You are right, is not yet in PyMC3, but Agustina and I have plans to continue developing it and adding it to PyMC3 this year.

Due to unavailability of the Simulator in pymc3 ,I am not able to experiment out the model ,but I would be very happy to contribute to it or to some other features if you want to add in the pymc3 module for improving the acceptance ratio /computational efficiency.

1 Like

@aloctavodia might have an experimental branch that you can test/contribute to

Hi @Adarsh-kumar your help is certainly appreciated. There are some changes in SMC that are now part of PyMC3 but not reflected yet in SMC-ABC, although @agustina may have a newer version I am not aware of. I will talk to Agustina next Monday (she is on vacations now) and we then could coordinate to work on this problem, is this OK with you?

Hi @ Adarsh-kumar. The Lotka-Volterra example should run on the code currently on this branch. It is not merged to pymc3’s master branch yet. I suggest you use this branch for testing.


thanks @agustina, it seems to me your branch has not incorporated the last changes in SMC, right?

That’s right!

@aloctavodia and @agustinaarroyuelo thanks for the response , I will test model on the branch mentioned by @agustinaarroyuelo .
I am ready to contribute from Monday , till then i will test the models on some example datasets /known distributions and get my hands on it.

hi @agustinaarroyuelo ,but I am getting the same error message while running the Lotka-Volterra example on the branch you mentioned.
AttributeError: module ‘pymc3’ has no attribute ‘Simulator’

@aloctavodia @agustinaarroyuelo may you recheck the branch on which I can test the The Lotka-Volterra example and will be able to contribute to the project in the coming time.

The Simulator distribution is here. You can try importing it as
from pymc3.distributions.simulator import Simulator. If that doesn’t work, then the most likely thing is that your python interpreter is looking up a different installation of pymc3 and not the fork that implements Simulator.

Hi, I was just about to write what @lucianopaz said. You can check here that the simulator code is present on the branch I linked you to.

Something you can do is install pymc3 using pip install -e (directory of the pymc3 repository).

@lucianopaz thanks , now I am able to run the Lotka-Volterrra example. I ran the model some times and the results are quite unstable ,like- the first vs third example -

fig0 ) ,@junpenglao @aloctavodia @agustinaarroyuelo ,It would be great to discuss with you and contribute to the part which can solve these issues.I have also explored some recent papers for better summary statistics calculation which can help us.paper_link

1 Like

@junpenglao please suggest me the part/feature that I should contribute to.Now i am able to run the experimental pymc3 branch on my system and will be able to do some experiments with that.

I think some notebook as example to start would be great! I would say the best way is to wait for Simulator to check in into PyMC3 - what is your plan on this end @agustinaarroyuelo @aloctavodia?

@junpenglao I am able to run the example notebooks like Lotka-Voltrra as well some other simple examples ,as you told to wait for simulator to check in to PYMC3 ,I am free to contribute/help @agustinaarroyuelo and @aloctavodia to get it done asap so that we can work on some other features .
@agustinaarroyuelo and @aloctavodia , it would be great if you share some updates about your plans .

BTW, I gather that you are using scipy function to generate ODE? You might find this interesting as well: Dynamical model in pymc3

Hi @Adarsh-kumar,

@agustinaarroyuelo just made a PR to include SMC-ABC into PyMC3. As this is an early version there is a lot of room for improving the code and the implemented algorithm, specially how to compute the epsilons as this is a critical step. Also there are a few new features in the SMC code that could be used in SMC-ABC. At some point it should be nice to refactor the code to avoid redundant code between SMC and SMC-ABC, but as a first approach we decided to make the SMC-ABC code as independent as possible from the rest of PyMC3 until we get a more or less stable version.

hello @junpenglao , thanks for your suggestion. I enjoyed experimenting the model shown in the Dynamic model in PYMC3 example rather than generating using scipy function and performed inference using both NUTS as well ADVI (Variational inference).

Using NUTS -

As suggested by @aloctavodia to contribute to the SMC-ABC part i will explore it, your suggestion regarding it are most welcome.

thanks @aloctavodia , I will explore regarding it and discussion with you soon.