HK1 function

The first Henze-Klar test statistic

The first Henze-Klar test statistic

This function computes the first test statistic of the goodness-of-fit test for the inverse Gaussian family due to Henze and Klar (2002).

HK1(data, a = 0)

Arguments

  • data: a vector of positive numbers.
  • a: positive tuning parameter.

Returns

value of the test statistic

Details

The representation of the first Henze-Klar test statistic used for computation is given by:

HKn,a(1)=φ^nnj,k=1nZ^jk1{1(Yj+Yk)(1+π2Z^jkerfce(Z^jk2))+(1+2Z^jk)YjYk}, HK_{n,a}^{(1)}= \frac{\hat{\varphi}_n}{n} \sum_{j,k=1}^{n} \hat{Z}_{jk}^{-1} \left\{ 1 - (Y_j + Y_k) \left( 1 + \sqrt{\frac{\pi}{2\hat{Z}_{jk}}} \text{erfce}\left( \sqrt{\frac{\hat{Z}_{jk}}{2}} \right) \right) + \left( 1 + \frac{2}{\hat{Z}_{jk}} \right) Y_j Y_k \right\},

with φ^n=λ^nμ^n\hat{\varphi}_n = \frac{\hat{\lambda}_n}{\hat{\mu}_n}, where μ^n,λ^n\hat{\mu}_n,\hat{\lambda}_n are the maximum likelihood estimators for μ\mu and λ\lambda, respectively, the parameters of the inverse Gaussian distribution. Furthermore Z^jk=φ^n(Yj+Yk+a)\hat{Z}_{jk} = \hat{\varphi}_n(Y_j + Y_k +a), where Yi=Xiμ^nY_i = \frac{X_i}{\hat{\mu}_n} for (Xi)i=1,...,n(X_i)_{i = 1,...,n}, a sequence of independent observations of a nonnegative random variable XX. To ensure numerical stability of the implementation the exponentially scaled complementary error function erfce(x)\text{erfce}(x) is used: erfce(x)=exp(x2)erfc(x)\text{erfce}(x) = \exp{(x^2)}\text{erfc}(x), with erfc(x)=2xexp(t2)dt/π\text{erfc}(x) = 2\int_x^\infty \exp{(-t^2)}dt/\pi. The null hypothesis is rejected for large values of the test statistic HKn,a(1)HK_{n,a}^{(1)}.

Examples

HK1(rmutil::rinvgauss(20,2,1))

References

Henze, N. and Klar, B. (2002) "Goodness-of-fit tests for the inverse Gaussian distribution based on the empirical Laplace transform", Annals of the Institute of Statistical Mathematics, 54(2):425-444. tools:::Rd_expr_doi("https://doi.org/10.1023/A:1022442506681")

  • Maintainer: Bruno Ebner
  • License: CC BY 4.0
  • Last published: 2024-11-01

Useful links