Thanks, Chris!
Yep, I can see it being challenging to come up with the general
approach to this. I guess a custom step sampler for the model indexing
stochastic variable would be the solution to this.
What about the issue of parent stochastics of the non-current model
being stepped through during the MCMC cycle? As they are not
contributing to the likelihood whether not the step is accepted is
arbitrary, and thus the sample will not be a real sample from the
posterior, right? I'm experimenting with a modification of the MCMC
object _loop method where it only steps stochastics that are the
parent of the current model. That is, instead of:
for step_method in self.step_methods:
if self.verbose > 2:
print_('Step method %s stepping' % step_method._id)
# Step the step method
step_method.step()
we have:
for step_method in self.step_method_dict[self.model_idx]:
step_method.step()
if self.model_idx == 0:
for step_method in
self.step_method_dict[self.geometric_p]:
step_method.step()
else:
for step_method in self.step_method_dict[self.poisson_mu]:
step_method.step()
(in this example, I am maintaining separate/independent stochastic
parameters for the Geometric and Poisson, instead of making one of
them a deterministic function of the other).
Is this a reasonable approach? Would I be adversely affecting some
other part of the MCMC machinery?