Code Monkey home page Code Monkey logo

Comments (3)

aloctavodia avatar aloctavodia commented on May 28, 2024

Hi @joannadiong thanks for getting in touch. I am very happy that these resources are useful to you.
Regarding your question, I think that differences are within the expected range. The method used by PyMC3 to compute the posterior (NUTS) is an stochastic method, thus each time you run it you will get slightly different results. You can fix the random seed used by pm.sample with the argument "random_seed". Additionally az.summary (without the kind="stats" argument) provides an stimate of the mc error, that is the error intruduced by the stochastic method. If you need to reduce the error you can increase the number of draws (1000 in your example) to a higher number. As rule of thumb I would say that setting draws=1000 or 2000 should be ok (specially if you are running at least two chains). I do not remember the chapter number, but in the book you will find one chapter with a discussion on how to diagnose the mcmc chains you be sure you are getting trustworthy results. Nevertheless if you need more info or have some more doubts doubts, please do not hesitate to ask questions here (or in pymc3 discourse).

from pymc-resources.

joannadiong avatar joannadiong commented on May 28, 2024

Hi @aloctavodia, thanks for the detailed and helpful explanation. I can manage those fixes and will keep working through the book.

For where I'm at in the book now, there are minor fixes needed for the notebook:

# Code 4.18
ax.imshow(zi, origin="bottom") # "bottom" would need to be "lower"

And trace_to_dataframe will soon be removed, which will break here:

# Code 4.32
trace_df = pm.trace_to_dataframe(trace_4_1) 

but I think there is an open issue for this.

I'm not familiar enough just yet with the packages and compiling the notebooks for pymc3 standards, but hopefully in time I'll learn enough to contribute more. Happy for you to close this issue if you feel the main things are covered. Many thanks again!

from pymc-resources.

aloctavodia avatar aloctavodia commented on May 28, 2024

Thanks for the report, this is all useful feedback. We should update the notebooks to directly work with ArviZ's InferenceData object.
Looking forward to more contributions from you. Let us know if you need help of have more doubts.

from pymc-resources.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.