Search code examples
rstatisticsgamma-distribution

What is the equivalent R function to GAMMA.INV(probability,alpha,beta) Excel function?


I need to find the inverse of the gamma cumulative distribution. I know there is GAMMA.INV(probability,alpha,beta) function just to do that in excel. How can I achieve this in R language?


Solution

  • In R, for most probability distributions, there are four functions, called d, p, q, r, (e.g., dnorm, pnorm, qnorm, rnorm) giving you the density (d), cumulative distribution function (p, since the result is a probability), its inverse (q, since the result is a quantile), and r to sample from the distribution.

    For the Gamma distribution, the inverse of the cumulative distribution function is therefore qgamma.