title: Generalized Inverse Gamma Distribution in R
body: <p>Mathematica has a four-parameter generalized inverse gamma distribution:</p>
  
  <p><a href="http://reference.wolfram.com/mathematica/ref/InverseGammaDistribution.html" rel="nofollow">http://reference.wolfram.com/mathematica/ref/InverseGammaDistribution.html</a></p>
  
  <p>and gives its PDF on that page too. Has anyone implemented the density, distribution, quantile, and sampling-from functions for that in R?</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>[Note this is <em>not</em> the generalized inverse Gaussian]</p>
  
  <p>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).</p>