Unfortunately, this is a model with a discrete parameter (switchpoint
is not continuous-valued), so it’s not possible to do inference on this model directly with HMC. greta is still HMC-focussed, so it’s not currently possible to fit this with one of the other samplers, just because greta doesn’t have the internal workings to deal with discrete parameters yet.
You can fit this type of model with HMC, but you need to explicitly marginalise out the discrete parameter. See the Stan example here:
There’s a prototype marginalise()
function being developed for greta that would make this straightforward, but it isn’t fully implemented yet.
So the short answer is that you can’t fit this in greta yet (at least not without writing a custom extension package and sone tensorflow code), but the ability to fit these models, by both the direct MCMC and marginalisation approaches, is on the to do list.