Trying to understand PyMC through examples, I made a small model referring to a set of birds weight (data observed: y20
), supposedly coming from a normal population N(mu, sigma)
.
> import pymc as pm
> import arviz as az
> with pm.Model() as model:
>
> # Priors for unknown model parameters
> mu = pm.Uniform('mu', lower = 0, upper = 2000)
> sigma = pm.Uniform('sigma', lower = 0, upper = 100)
>
> # Likelihood of observations
> lkd = pm.Normal('likelihood', mu = mu, sigma = sigma, observed = y20)
>
> # Expected value of outcome
> weights = pm.Normal('weights', mu = mu, sigma = sigma)
This pm.Model()
runs without problem. Now about sampling…
Browsing docs, I found in the “read the docs” tutorial, here: HERE, paragraph 3.5.1
, the following sentence: MCMC often results in strong autocorrelation among samples that can result in imprecise posterior inference. To circumvent this, it is useful to thin the sample by only retaining every k th sample, where k is an integer value. This thinning interval is passed to the sampler via the thin argument.
So, after my model, I used this new line:
> with model:
> trace = pm.sample(1000, tune = 1000, thin = 10)
and I got a strange consequence:
> ValueError: Unused step method arguments: {'thin'}
Has something changed in PyMC?