| Statistics Toolbox | Search  Help Desk |
| gaminv | Examples |
Inverse of the gamma cumulative distribution function (cdf).
Syntax
X = gaminv(P,A,B)
Description
gaminv(P,A,B) computes the inverse of the gamma cdf with parameters A and B for the probabilities in P. The arguments P, A and B must all be the same size except that scalar arguments function as constant matrices of the common size of the other arguments. The parameters A and B must both be positive and P must lie on the interval
Algorithm
There is no known analytic solution to the integral equation above. gaminv uses an iterative approach (Newton's method) to converge to the solution.Examples
This example shows the relationship between the gamma cdf and its inverse function.a = 1:5;
b = 6:10;
x = gaminv(gamcdf(1:5,a,b),a,b)
x =
1.0000 2.0000 3.0000 4.0000 5.0000