Note to future self
Yes, you can use a transformation (as pointed out by @junpenglao) with example here. Initially it looks a bit ARGH, but it’s pretty simple:
- initially I had two variables
k1andk2and wanted them to be ordered. - solution 1 was to reparameterize so that
k2=k1+bwhereb>0. This seemed to work judging by some posterior predictive plots, but the chains were in fact all over the place. - so solution 2 was to use the ordered transform in the link above. It’s pretty simple… just add the
Orderedclass, then add something like, transform=Ordered(), testval=[0.1, 0.2]into the definition of the PyMC3 stochastic variable
More details at #2 on the repo