Main Content

gamfit

Gamma parameter estimates

Syntax

phat = gamfit(data)
[phat,pci] = gamfit(data)
[phat,pci] = gamfit(data,alpha)
[...] = gamfit(data,alpha,censoring,freq,options)

Description

phat = gamfit(data)returns the maximum likelihood estimates (MLEs) for the parameters of the gamma distribution given the data in vectordata.

[phat,pci] = gamfit(data)returns MLEs and 95% percent confidence intervals. The first row ofpciis the lower bound of the confidence intervals; the last row is the upper bound.

[phat,pci] = gamfit(data,alpha)returns100(1 - alpha)% confidence intervals. For example,alpha=0.01yields 99% confidence intervals.

[...] = gamfit(data,alpha,censoring)accepts a Boolean vector of the same size asdatathat is 1 for observations that are right-censored and 0 for observations that are observed exactly.

[...] = gamfit(data,alpha,censoring,freq)accepts a frequency vector of the same size asdata.freqtypically contains integer frequencies for the corresponding elements indata, but may contain any nonnegative values.

[...] = gamfit(data,alpha,censoring,freq,options)accepts a structure,options,指定iterat控制参数ive algorithm the function uses to compute maximum likelihood estimates. The gamma fit function accepts anoptionsstructure which can be created using the functionstatset. Enterstatset('gamfit')to see the names and default values of the parameters thatgamfitaccepts in theoptionsstructure.

Examples

Fit a gamma distribution to random data generated from a specified gamma distribution:

a = 2; b = 4; data = gamrnd(a,b,100,1); [p,ci] = gamfit(data) p = 2.1990 3.7426 ci = 1.6840 2.8298 2.7141 4.6554

References

[1] Hahn, Gerald J., and S. S. Shapiro.Statistical Models in Engineering. Hoboken, NJ: John Wiley & Sons, Inc., 1994, p. 88.

Extended Capabilities

Version History

Introduced before R2006a