Hello, I recently purchased Allen Downey’s Think Bayes - I’m working through Chapter 20 - Counting Cells (the chapter can be opened in Google Colab here). There is a question I’m pondering that affects some of my models. It seems that we do not want all random variables to be adaptive (i.e., have changeable parameters). For example, in the snippet below, we want
yeast_conc to be adaptive because that is what we are inferring. But we do not want
shaker1_vol to be adaptive because it is measured outside of the model; it is a stochastic, but we don’t want
sd to be changed by sampling.
with pm.Model() as model: yeast_conc = pm.Normal("yeast conc", mu=2 * billion, sd=0.4 * billion) shaker1_vol = pm.Normal("shaker1 vol", mu=9.0, sd=0.05)
My question is two-part, one related to this example, and one general:
- For anyone who has worked this example, do you agree that
shaker1_volshould be a frozen/ non-adaptive distribution rather than a random variable, as presently coded?
- How would we go about coding a non-adaptive stochastic variable into a model in pymc3? I considered adding a hierarchical layer where
sdare really narrow truncated priors to constrain
shaker1_vol. But maybe there is a better way if this is a common problem.