Statistics: gamrnd

### Function Reference: `gamrnd`

statistics: r = gamrnd (k, theta)
statistics: r = gamrnd (k, theta, rows)
statistics: r = gamrnd (k, theta, rows, cols, …)
statistics: r = gamrnd (k, theta, [sz])

Random arrays from the Gamma distribution.

`r = gamrnd (k, theta)` returns an array of random numbers chosen from the Gamma distribution with shape parameter k and scale parameter theta. The size of r is the common size of k and theta. A scalar input functions as a constant matrix of the same size as the other inputs.

When called with a single size argument, `gamrnd` returns a square matrix with the dimension specified. When called with more than one scalar argument, the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. The size may also be specified with a row vector of dimensions, sz.

There are two equivalent parameterizations in common use:

1. With a shape parameter k and a scale parameter θ, which is used by `gamrnd`.
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: gamcdf, gaminv, gampdf, gamfit, gamlike, gamstat

Source Code: gamrnd