gamma.test: Test for the Gamma distribution

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

Description

Test of fit for the Gamma distribution with unknown shape and scale parameters based on the ratio of two variance estimators (Villasenor and Gonzalez-Estrada, 2015).

Usage

1

Arguments

x

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

Details

The test statistic is the ratio of two variance estimators, namely, the sample variance and the moments estimator obtained by Villasenor and Gonzalez-Estrada (2015), which is the product of the sample mean of X and the sample covariance of X and log(X).

The asymptotic null distribution of the test statistic is used to approximate p-values.

NOTE: the unbiased sample covariance estimator is used to compute the test statistic.

Value

A list with class "htest" containing the following components.

statistic

the calculated value of the test statistic.

p.value

the approximated p-value of the test.

method

the character string "Test of fit for the Gamma distribution".

data.name

a character string giving the name of the data set.

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_fit for fitting a Gamma distribution to data.

Examples

1
2
3
4
5
6
7
# Testing the gamma distribution hypothesis on the logarithm of variable Loss 
# of the danishuni data set 
library(fitdistrplus)
data(danishuni) 
logLoss <- log(danishuni$Loss)   # logarithm of Loss variable
logLoss <- logLoss[logLoss > 0]  # observations > 0
gamma_test(logLoss)                 

Example output

Loading required package: fitdistrplus
Loading required package: MASS
Loading required package: survival

	Test of fit for the Gamma distribution

data:  logLoss
V = -0.32803, p-value = 0.8166

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

Related to gamma.test in goft...