Mathematica has a four-parameter generalized inverse gamma distribution:
http://reference.wolfram.com/mathematica/ref/InverseGammaDistribution.html
and gives its PDF on that page too. Has anyone implemented the density, distribution, quantile, and sampling-from functions for that in R?
I did make a quick start (the PDF is just the equations on that page translated into R) but if its done already I’ll not bother with implementing the CDF and the quantile function.
Does a general function for computing the CDF (by integration of PDF) and the Quantile (by inversion of the CDF) of any distribution given the PDF exist?
[Note this is not the generalized inverse Gaussian]
Note also the ‘Properties and Relations’ dropdown on the Mathematica page, which seems to imply its not a special case or generalisation of anything (apart from the inverse gamma).
I started a package to implement this:
https://github.com/barryrowlingson/geninvgamma
Its only using simple inversion and integration of the density, so nothing clever. Currently random samples from the distribution are done by generating a U(0,1) and getting the quantile, which isn’t very efficient or very accurate it seems..
Anyway, its a start.