| Statistics Toolbox | Search  Help Desk |
| gamfit | Examples See Also |
Parameter estimates and confidence intervals for gamma distributed data.
Syntax
phat = gamfit(x) [phat,pci] = gamfit(x) [phat,pci] = gamfit(x,alpha)
Description
phat = gamfit(x) returns the maximum likelihood estimates of the parameters of the gamma distribution given the data in the vector, x.
[phat,pci] = gamfit(x) gives MLEs and 95% percent confidence intervals. The first row of pci is the lower bound of the confidence intervals; the last row is the upper bound.
[phat,pci] = gamfit(x,alpha) returns 100(1-alpha) percent confidence intervals. For example, alpha = 0.01 yields 99% confidence intervals.
Example
Note the 95% confidence intervals in the example bracket the "true" parameter values, 2 and 4, respectively.a = 2; b = 4;
r = gamrnd(a,b,100,1);
[p,ci] = gamfit(r)
p =
2.1990 3.7426
ci =
1.6840 2.8298
2.7141 4.6554
Reference
Hahn, G. J., and S.S. Shapiro, Statistical Models in Engineering, Wiley Classics Library John Wiley & Sons, New York. 1994. p. 88.See Also
betafit,binofit,expfit,normfit,poissfit,unifit,weibfit