Reject invalid parameter vector during HMC sampling

You can return a logp of -np.inf or np.nan. Both will be treated as a divergence by the sampler.
If you are still working on ode models, you might be interested in sunode: https://github.com/aseyboldt/sunode

1 Like