Cannot sample with DEMetropolis* when using pm.Constant

That’s a bummer. Hard-coding the constant values will require changing the model API, which limits experimentation. Unless, is it possible(?) to do something like:

m = pm.Constant('m', c = 0.4)
theta = at.as_tensor_variable([m, c]) # Instead of this

theta = at.as_tensor_variable([0.4, c]) # Do this?

This does seem to work (in this toy example), so maybe I don’t have to change my API. Both pm.Constant and pm.DiscreteUniform did work with DEMetropolis* samplers in v3.11.5 (numerical issues notwithstanding), so I was caught off-guard here. But thanks for your help!

1 Like