Customized likelihoods, and HMC alternatives


Hi, just checking on what the latest status of greta is: is it the case that you can’t yet define your own customized likelihood functions?

Also, what’s the current status of alternative MCMC methods for e.g. discrete data?

Thanks very much,


Hi Louise,

greta has Random Walk Metropolis Hastings and Slice samplers for discrete data.

You can define your own distributions (see for example here) though I’m not sure if that’s what you mean.

All the best!


Hi Voltemand,

Yes, I think the customized distributions is what I needed.

And thanks for the update about the RW MH. I was looking through the “getting started” vignette which currently still has text at the bottom implying that greta doesn’t yet have discrete samplers, so I just wanted to check if that was still the case.

Thanks for your quick and helpful reply!


Hi Louise,

Unless something has changed very recently, you still won’t be able to sample from discrete random variables. You can include discrete data (e.g. fitting a model to observed count data with a discrete likelihood, see examples here).



Hi Jian,

You’re right, it looks like although RWMH is now available as a sampler, it still only works for continuous variables. Oh well, I’ll have to wait a bit longer and go away and use Rcpp in the meantime.



Hi Voltemand, it looks like the RWMH isn’t actually for discrete data, since it says it only accepts normal or uniform proposals, which to me seems like it’s for continuous data.



That seems right - sorry about that! I’m not super familiar with the samplers.