Learn R Programming

goft (version 1.3.6)

gamma_test: Test for the Gamma distribution

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

gamma_test(x)

Arguments

x

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

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.

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.

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

Run this code
# NOT RUN {
# 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)                 
# }

Run the code above in your browser using DataLab