Gamma(.., ..)^2 -> generalized_gamma(?, ?, ?)

I don’t recall writing one, I would just use a slice sampler, just make sure you work with the log density… sorry, I had a simple R implememtation kicking around but I can’t find it right now. Really a more sensible thing is to work with the RNG from R’s flexsurv package. If you want to see how the parameterizations are related check out this repo: https://github.com/sakrejda/survival-densities

Specifically, here are tests relating flexsurv’s parameterizations to mine, for 1S: https://github.com/sakrejda/survival-densities/blob/master/code/waitup/waitup/tests/testthat/test-generalized_gamma_1-pdf-matches-cdf.R

If you want to check out that package you need to clone the repo and build it using cmake, I haven’t published a build yet. Just comment out the fits subdirectory or it’ll build a lot of other stuff, the manuscripts subdir has an .Rmd file that writes down the math for these densities in detail… I’ll just upload a build when I get the chance but it might not be for a few days.