I am having trouble to understand how does the iteration are made with different compounds steps.
I’m running the model explained in:
And it’s using the NUTS sampler for the continuous variable and CategoricalGibbsMetropolis sampler for the two discrete variables.
The only explanation I could find in the documentation is:
“sampling proceeds by first applying step1 then step2 at each iteration.” I don’t really understand how the two sampler could be used at each iteration.
and an open issue on github that raises the issue that compound step in sampling is not explained in the documentation:
From what I can see when I plot the step_size_bar, I understand it as it runs all the iteration using the first sampler and then run all the iterations again using the second sampler:
n = aCH_.eval().shape[1]
with pm.Model() as basic_model:
# Priors for unknown model parameters
b1 = pm.Uniform('b1', lower=0.3, upper=0.5, testval=0.45)
ncomp_aCH = pm.Categorical('ncomp_aCH', p=np.ones(n)/n)
ncomp_aCOH = pm.Categorical('ncomp_aCOH', p=np.ones(n)/n)
aCH=aCH_[0, ncomp_aCH]
aCOH=aCOH_[0, ncomp_aCOH]
out= b1*aCH+aCOH
# Likelihood (sampling distribution) of observations
Y_obs = pm.Normal('Y_obs', mu=out, tau=sigma, observed=Y)
trace = pm.sample(2000000, progressbar=True)
plt.plot(trace['step_size_bar'])
plt.show()
Does anyone have any other informations on how does compound step sampling works?