HK1 {gofIG} | R Documentation |
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)
data |
a vector of positive numbers. |
a |
positive tuning parameter. |
The representation of the first Henze-Klar test statistic used for computation is given by:
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 \hat{\varphi}_n = \frac{\hat{\lambda}_n}{\hat{\mu}_n}
, where \hat{\mu}_n,\hat{\lambda}_n
are the maximum likelihood estimators for \mu
and \lambda
, respectively, the parameters of the inverse Gaussian distribution.
Furthermore \hat{Z}_{jk} = \hat{\varphi}_n(Y_j + Y_k +a)
, where Y_i = \frac{X_i}{\hat{\mu}_n}
for (X_i)_{i = 1,...,n}
, a sequence of independent observations of a nonnegative random variable X
.
To ensure numerical stability of the implementation the exponentially scaled complementary error function \text{erfce}(x)
is used: \text{erfce}(x) = \exp{(x^2)}\text{erfc}(x)
, with \text{erfc}(x) = 2\int_x^\infty \exp{(-t^2)}dt/\pi
.
The null hypothesis is rejected for large values of the test statistic HK_{n,a}^{(1)}
.
value of the test statistic
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. doi:10.1023/A:1022442506681
HK1(rmutil::rinvgauss(20,2,1))