Hi all, I am new to Bayesian statistics, and I am trying to run the following code from the Bayesian Modeling and Computation in Python book (which was using PyMC3):

with pm.Model() as model_0:
θ1 = pm.Normal("θ1", 0, 1, initval=0.1)
θ2 = pm.Uniform("θ2", -θ1, θ1)
idata_0 = pm.sample(return_inferencedata=True)

However I got the following error message

MissingInputError: Input 0 (θ1) of the graph (indices start from 0), used to compute Neg(θ1), was not provided and not given a value. Use the PyTensor flag exception_verbosity='high', for more information on this error.

I wonder why do I get this error, and how should I fix it in PyMC5? Thank you!

That’s true, and that’s something making me frustrated I am trying to learn more about PyMC or Tensorflow Probability, but everything source (this book, and the Bayesian Methods for Hackers book I found are outdated, even many official examples are not working (at least for the last time I checked. Apology if they have been updated) Wonder if you or anyone esle have suggestions about how should I learn more about PyMC and PPL?

@cluhmannThe intention of that example was to generate divergences using a very simple model. Not sure why it does not run with PyMC 5.x, it did with PyMC 3.x

@Yijun_X Sorry for the frustration, my recommendation when reading books with code is to stick to the version used in the books, and only switch to a new version once you understand the material. Otherwise, the code can easily become an obstacle instead of an enabler.

We, the authors of Bayesian Modeling and Computation in Python, are thinking about a second edition with PyMC 5, but it will take a year or more to be published.

Thank you @ricardoV94 ! Maybe another rookie question: I wonder how long would this fix take to be included in the next release? Wonder where can I find doc about the development process? Thank you!