Statistics Toolbox | ![]() ![]() |
Mean and variance for the gamma distribution
Syntax
Description
[M,V] = gamstat(A,B)
returns the mean and variance for the gamma distribution with parameters specified by A
and B
. Vector or matrix inputs for A
and B
must have the same size, which is also the size of M
and V
. A scalar input for A
or B
is expanded to a constant matrix with the same dimensions as the other input.
The mean of the gamma distribution with parameters a and b is ab. The variance is ab2.
Examples
[m,v] = gamstat(1:5,1:5) m = 1 4 9 16 25 v = 1 8 27 64 125 [m,v] = gamstat(1:5,1./(1:5)) m = 1 1 1 1 1 v = 1.0000 0.5000 0.3333 0.2500 0.2000
See Also
gamcdf
, gamfit
, gaminv
, gamlike
, gampdf
, gamrnd
![]() | gamrnd | geocdf | ![]() |