Gamma inverse cumulative distribution function
X = gaminv(P,A,B)
[X,XLO,XUP] = gaminv(P,A,B,pcov,alpha)
X = gaminv(P,A,B) computes the inverse of the gamma
cdf with shape parameters in
A and scale parameters in
for the corresponding probabilities in
B can be vectors, matrices, or multidimensional
arrays that all have the same size. A scalar input is expanded to a constant array with the
same dimensions as the other inputs. The parameters in
B must all be positive, and the values in
P must lie
on the interval
The gamma inverse function in terms of the gamma cdf is
[X,XLO,XUP] = gaminv(P,A,B,pcov,alpha) produces confidence bounds for
X when the input parameters
pcov is a 2-by-2 matrix containing the covariance matrix of
the estimated parameters.
alpha has a default value of 0.05, and specifies
100(1-alpha)% confidence bounds.
XUP are arrays of the same size as
X containing the
lower and upper confidence bounds.
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
There is no known analytical solution to the integral equation
gaminv uses an iterative approach (Newton's
method) to converge on the solution.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).