### Function Reference: `gamrnd`

statistics: r = gamrnd (a, b)
statistics: r = gamrnd (a, b, rows)
statistics: r = gamrnd (a, b, rows, cols, …)
statistics: r = gamrnd (a, b, [sz])

Random arrays from the Gamma distribution.

`r = gamrnd (a, b)` returns an array of random numbers chosen from the Gamma distribution with shape parameter a and scale parameter b. The size of r is the common size of a and b. 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.

OCTAVE/MATLAB use the alternative parameterization given by the pair α, β, i.e. shape a and scale b. In Wikipedia, the two common parameterizations use the pairs k, θ, as shape and scale, and α, β, as shape and rate, respectively. The parameter names a and b used here (for MATLAB compatibility) correspond to the parameter notation k, θ instead of the α, β as reported in Wikipedia.

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