Comments (3)
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.
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.
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)
- Add Bayes Rules Chapter 2 HOT 1
- Fix up env for bayes rules
- Chapter 5 - Code 5.29 should use log(mass) HOT 3
- Chp_02.ipynb, import statement HOT 2
- Conflicting chain size for code block 4.59
- causalgraphicalmodels import error with Python 3.10 HOT 5
- Chapter 5 import error when running pymc model HOT 9
- Chp_11 notebook - models not running - Got error No model on context stack
- Incompatibilities with Python 3.10 for the aesara 2.6.6 and causalgraphicalmodels-0.0.4 packages.
- issue importing pymc3 "cannot import as scalar from numpy"
- Error for code snippet 8.8 - NotImplementedError HOT 3
- Adding exposition about PyMC and Arviz to the Rethinking_2 code.
- Type error - Code 15.12 - pymc v4 HOT 4
- Rethinking_2/Chp_02.ipynb: Mistake in quadratic approximation ("Code 2.6")? HOT 5
- Resources/Rethinking_2/Chp_04.ipynb: The hyperlink in Code 4.26 is broken HOT 1
- Gender Categories in Chapter 4
- rethinking chpater5 notebook: 5.34 ValueError: shape mismatch: objects cannot be broadcast to a single shape. HOT 2
- Using pymc (v5) to run rethinking notebooks HOT 1
- Sampling performance b-splines model chapter 04 HOT 1
- pre-commit is failing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymc-resources.