I'm working with a 6-dimensional Bayesian model, and the affine-invariant sampler implemented in emcee
. Four of those parameters are discrete, while the other two are continuous.
emcee
will propose continuos values for all the parameters as the next step in the sampler. The way I currently handle this is to "push" the values for the discrete parameters towards the closest "valid" values (ie: those in the discrete set), before passing the new step to the likelihood evaluation.
For example, assuming the first four parameters are the discrete ones, if the next step proposed by emcee
is:
$A=(0.26234, 12.5567, 0.00544, 9.56, 0.4674, 1.333)$
I will change this to the "pushed" proposed step:
$A_p=(0.26, 12.56, 0.005, 9.6, 0.4674, 1.333)$
where the first four parameters are now "valid", and then evaluate the likelihood.
Is this a proper approach or am I messing up my samples? Are there other approaches? I also find that my chains (emcee
works with multiple parallel chains) don't mix. The mean acceptance rate for all chains is below 1% and they can be seen stuck at a single value for almost their entire length. Could this be causing this problem?