Statistics: gamcdf

### Function Reference: `gamcdf`

statistics: p = gamcdf (x, k)
statistics: p = gamcdf (x, k, theta)
statistics: p = gamcdf (…, `"upper"`)
statistics: [p, plo, pup] = evcdf (x, k, theta, pcov)
statistics: [p, plo, pup] = evcdf (x, k, theta, pcov, alpha)
statistics: [p, plo, pup] = evcdf (…, `"upper"`)

Gamma cumulative distribution function (CDF).

For each element of x, compute the cumulative distribution function (CDF) of the Gamma distribution with shape parameter k and scale parameter theta. When called with only one parameter, then theta defaults to 1. The size of p is the common size of x, k, and theta. A scalar input functions as a constant matrix of the same size as the other inputs.

When called with three output arguments, i.e. `[p, plo, pup]`, `gamcdf` computes the confidence bounds for p when the input parameters k and theta are estimates. In such case, pcov, a 2×2 matrix containing the covariance matrix of the estimated parameters, is necessary. Optionally, alpha, which has a default value of 0.05, specifies the `100 * (1 - alpha)` percent confidence bounds. plo and pup are arrays of the same size as p containing the lower and upper confidence bounds.

`[…] = gamcdf (…, "upper")` computes the upper tail probability of the Gamma distribution with parameters k and theta, at the values in x.

There are two equivalent parameterizations in common use:

1. With a shape parameter k and a scale parameter θ, which is used by `gamcdf`.
2. With a shape parameter α = k and an inverse scale parameter β = 1 / θ, called a rate parameter.

Further information about the Gamma distribution can be found at https://en.wikipedia.org/wiki/Gamma_distribution

See also: gaminv, gampdf, gamrnd, gamfit, gamlike, gamstat

Source Code: gamcdf

### Example: 1

     ## Plot various CDFs from the Gamma distribution
     x = 0:0.01:20;
     p1 = gamcdf (x, 1, 2);
     p2 = gamcdf (x, 2, 2);
     p3 = gamcdf (x, 3, 2);
     p4 = gamcdf (x, 5, 1);
     p5 = gamcdf (x, 9, 0.5);
     p6 = gamcdf (x, 7.5, 1);
     p7 = gamcdf (x, 0.5, 1);
     plot (x, p1, "-r", x, p2, "-g", x, p3, "-y", x, p4, "-m", ...
           x, p5, "-k", x, p6, "-b", x, p7, "-c")
     grid on
     legend ({"α = 1, θ = 2", "α = 2, θ = 2", "α = 3, θ = 2", ...
              "α = 5, θ = 1", "α = 9, θ = 0.5", "α = 7.5, θ = 1", ...
              "α = 0.5, θ = 1"}, "location", "southeast")
     title ("Gamma CDF")
     xlabel ("values in x")
     ylabel ("probability")