testExponential {gofedf}R Documentation

Apply Goodness of Fit Test for Exponential Distribution

Description

Performs the goodness-of-fit test based on empirical distribution function to check if an i.i.d sample follows an Exponential distribution.

Usage

testExponential(
  x,
  ngrid = length(x),
  gridpit = FALSE,
  hessian = FALSE,
  method = "cvm"
)

Arguments

x

a non-empty numeric vector of sample data.

ngrid

the number of equally spaced points to discretize the (0,1) interval for computing the covariance function.

gridpit

logical. If TRUE (the default value), the parameter ngrid is ignored and (0,1) interval is divided based on probability inverse transformed values obtained from the sample. If FALSE, the interval is divided into ngrid equally spaced points for computing the covariance function.

hessian

logical. If TRUE the Fisher information matrix is estimated by the observed Hessian Matrix based on the sample. If FALSE (the default value) the Fisher information matrix is estimated by the variance of the observed score matrix.

method

a character string indicating which goodness-of-fit statistic is to be computed. The default value is 'cvm' for the Cramer-von-Mises statistic. Other options include 'ad' for the Anderson-Darling statistic, and 'both' to compute both cvm and ad.

Value

A list of two containing the following components:

Examples

set.seed(123)
n <- 50
sim_data <- rexp(n, rate = 2)
testExponential(x = sim_data)

[Package gofedf version 0.1.0 Index]