gamma.fit: Fitting the Gamma distribution to data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Fits a Gamma distribution to a random sample of positive real numbers using Villasenor and Gonzalez-Estrada (2015) parameter estimators.

Usage

1

Arguments

x

a numeric data vector containing a random sample of positive real numbers.

Details

The Gamma distribution with shape and scale parameters is considered. The scale parameter is estimated by the unbiased sample estimator of the covariance of X and log(X). The shape parameter is estimated by the ratio of the sample mean of X and the scale parameter estimator.

Value

Shape and scale parameter estimates.

Author(s)

Elizabeth Gonzalez-Estrada egonzalez@colpos.mx, Jose A. Villasenor-Alva

References

Villasenor, J.A. and Gonzalez-Estrada, E. (2015). A variance ratio test of fit for Gamma distributions. Statistics and Probability Letters, 96 1, 281-286. http://dx.doi.org/10.1016/j.spl.2014.10.001

See Also

gamma_test for testing the Gamma distribution hypothesis.

Examples

1
2
3
4
5
6
7
# Fitting a gamma distribution to the logarithm of variable Loss contained in
# the danishuni data set 
library(fitdistrplus)
data(danishuni) 
logLoss <- log(danishuni$Loss)   # logarithm of Loss variable
logLoss <- logLoss[logLoss > 0]  # observations > 0
gamma_fit(logLoss)                 

Example output

Loading required package: fitdistrplus
Loading required package: MASS
Loading required package: survival
Loading required package: npsurv
Loading required package: lsei
      Parameter estimates
shape           1.2114035
scale           0.6529328

goft documentation built on July 1, 2020, 5:56 p.m.

Related to gamma.fit in goft...