Title: | Goodness-of-Fit Tests for the Inverse Gaussian Distribution |
---|---|
Description: | We implement various tests for the composite hypothesis of testing the fit to the family of inverse Gaussian distributions. Included are methods presented by Allison, J.S., Betsch, S., Ebner, B., and Visagie, I.J.H. (2022) <doi:10.48550/arXiv.1910.14119>, as well as two tests from Henze and Klar (2002) <doi:10.1023/A:1022442506681>. Additionally, the package implements a test proposed by Baringhaus and Gaigall (2015) <doi:10.1016/j.jmva.2015.05.013>. For each test a parametric bootstrap procedure is implemented. |
Authors: | Bruno Ebner [aut, cre], Jaco Visagie [aut], Steffen Betsch [aut], James Allison [aut], Lucas Iglesias [ctb] |
Maintainer: | Bruno Ebner <[email protected]> |
License: | CC BY 4.0 |
Version: | 1.0 |
Built: | 2025-01-31 05:24:15 UTC |
Source: | https://github.com/cran/gofIG |
This function computes the first test statistic of the goodness-of-fit tests for the inverse Gaussian family due to Allison et al. (2022). Two different estimation procedures are implemented, namely the method of moment and the maximum likelihood method.
ABEV1(data, a = 10, meth = "MME")
ABEV1(data, a = 10, meth = "MME")
data |
a vector of positive numbers. |
a |
positive tuning parameter. |
meth |
method of estimation used. Possible values are |
The numerically stable test statistic for the first Allison-Betsch-Ebner-Visagie test is defined as:
with , where
are consistent estimators of
, respectively, the parameters of the inverse Gaussian distribution. Furthermore
,
, for
, a sequence of independent observations of a positive random variable
. The functions
,
, are defined in Allison et al. (2022), section 5.1.
The null hypothesis is rejected for large values of the test statistic
.
value of the test statistic.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2022) "On Testing the Adequacy of the Inverse Gaussian Distribution". LINK
ABEV1(rmutil::rinvgauss(20,2,1),a=10,meth='MLE')
ABEV1(rmutil::rinvgauss(20,2,1),a=10,meth='MLE')
This function computes the second test statistic of the goodness-of-fit tests for the inverse Gaussian family due to Allison et al. (2022). Two different estimation procedures are implemented, namely the method of moment and the maximum likelihood method.
ABEV2(data, a = 10, meth = "MME")
ABEV2(data, a = 10, meth = "MME")
data |
a vector of positive numbers. |
a |
positive tuning parameter. |
meth |
method of estimation used. Possible values are |
The numerically stable test statistic for the second Allison-Betsch-Ebner-Visagie test is defined as:
with , where
are consistent estimators of
, respectively, the parameters of the inverse Gaussian distribution. Furthermore
,
, for
, a sequence of independent observations of a positive random variable
.
The functions
,
, are defined in Allison et al. (2022), section 5.1, and
denotes the distribution function of the standard normal distribution.
The null hypothesis is rejected for large values of the test statistic
.
value of the test statistic.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2022) "On Testing the Adequacy of the Inverse Gaussian Distribution". LINK
ABEV2(rmutil::rinvgauss(20,2,1),a=10,meth='MLE')
ABEV2(rmutil::rinvgauss(20,2,1),a=10,meth='MLE')
This function computes the test statistic of the goodness-of-fit test for the inverse Gaussian family in the spirit of Anderson and Darling.
AD(data)
AD(data)
data |
a vector of positive numbers. |
Let denote the
th order statistic of
, a sequence of independent observations of a positive random variable
. Furthermore, let
, where
is the distribution function of the inverse Gaussian distribution.
Note that
are the maximum likelihood estimators for
and
, respectively, the parameters of the inverse Gaussian distribution.
The null hypothesis is rejected for large values of the test statistic:
value of the test statistic.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2022) "On Testing the Adequacy of the Inverse Gaussian Distribution". LINK
AD(rmutil::rinvgauss(20,2,1))
AD(rmutil::rinvgauss(20,2,1))
This function computes the test statistic of the goodness-of-fit test for the inverse Gaussian family due to Baringhaus and Gaigall (2015).
BG(data)
BG(data)
data |
a vector of positive numbers. |
The test statistic of the Baringhaus-Gaigall test is defined as:
where
with being the indicator function.
Let
and
, with
positive, independent and identically distributed random variables with finite moments
and
.
Then
. Note that
and
are independent if, and only if
are realized from an inverse Gaussian distribution.
value of the test statistic.
Baringhaus, L. Gaigall, D. (2015). "On an independence test approach to the goodness-of-fit problem", Journal of Multivariate Analysis, 140, 193-208. doi:10.1016/j.jmva.2015.05.013
BG(rmutil::rinvgauss(20,2,1))
BG(rmutil::rinvgauss(20,2,1))
This function computes value of the test statistic of the goodness-of-fit test for the inverse Gaussian family in the spirit of Cramer and von Mises. Note that this tests the composite hypothesis of fit to the family of inverse Gaussian distributions.
CM(data)
CM(data)
data |
a vector of positive numbers. |
Let denote the
th order statistic of
, a sequence of independent observations of a positive random variable
. Furthermore, let
, where
is the distribution function of the inverse Gaussian distribution.
Note that
are the maximum likelihood estimators for
and
, respectively, the parameters of the inverse Gaussian distribution.
The null hypothesis is rejected for large values of the test statistic:
value of the test statistic.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2022) "On Testing the Adequacy of the Inverse Gaussian Distribution". LINK
CM(rmutil::rinvgauss(20,2,1))
CM(rmutil::rinvgauss(20,2,1))
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)
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:
with , where
are the maximum likelihood estimators for
and
, respectively, the parameters of the inverse Gaussian distribution.
Furthermore
, where
for
, a sequence of independent observations of a nonnegative random variable
.
To ensure numerical stability of the implementation the exponentially scaled complementary error function
is used:
, with
.
The null hypothesis is rejected for large values of the test statistic
.
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))
HK1(rmutil::rinvgauss(20,2,1))
This function computes the test statistic of the second goodness-of-fit test for the inverse Gaussian family due to Henze and Klar (2002).
HK2(data)
HK2(data)
data |
a vector of positive numbers. |
The representation of the second Henze-Klar test statistic used for computation is given by:
with , where
are the maximum likelihood estimators for
and
, respectively, the parameters of the inverse Gaussian distribution.
Furthermore
and
, where
for
, a sequence of independent observations of a nonnegative random variable
.
To ensure numerical stability of the implementation the exponentially scaled complementary error function
is used:
, with
.
The null hypothesis is rejected for large values of the test statistic
.
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
HK2(rmutil::rinvgauss(20,2,1))
HK2(rmutil::rinvgauss(20,2,1))
This function computes the test statistic of the goodness-of-fit test for the inverse Gaussian family in the spirit of Kolmogorov and Smirnov. Note that this tests the composite hypothesis of fit to the family of inverse Gaussian distributions.
KS(data)
KS(data)
data |
a vector of positive numbers. |
Let denote the
th order statistic of
, a sequence of independent observations of a positive random variable
. Furthermore, let
, where
is the distribution function of the inverse Gaussian distribution.
Note that
are the maximum likelihood estimators for
and
, respectively, the parameters of the inverse Gaussian distribution.
The null hypothesis is rejected for large values of the test statistic:
where
and
value of the test statistic.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2022) "On Testing the Adequacy of the Inverse Gaussian Distribution". LINK
KS(rmutil::rinvgauss(20,2,1))
KS(rmutil::rinvgauss(20,2,1))
Printing objects of class "gofIG".
## S3 method for class 'gofIG' print(x, ...)
## S3 method for class 'gofIG' print(x, ...)
x |
object of class "gofIG". |
... |
further arguments to be passed to or from methods. |
A gofIG
object is a named list of numbers and character string, supplemented with test
(the name of the teststatistic). test
is displayed as a title.
The remaining elements are given in an aligned "name = value" format.
the argument x, invisibly, as for all print methods.
print(test.ABEV1(rgamma(20,1)))
print(test.ABEV1(rgamma(20,1)))
This function computes the goodness-of-fit test for the inverse Gaussian family due to Allison et al. (2019). Two different estimation procedures are implemented, namely the method of moment and the maximum likelihood method.
test.ABEV1(data, a = 10, meth = "MME", B = 500)
test.ABEV1(data, a = 10, meth = "MME", B = 500)
data |
a vector of positive numbers. |
a |
positive tuning parameter. |
meth |
method of estimation used. Possible values are |
B |
number of bootstrap iterations used to obtain p value. |
The test is of weighted type and uses a characterization of the distribution function of the inverse Gaussian distribution. The p value is obtained by a parametric bootstrap procedure.
a list containing the value of the name of the test statistic, the used tuning parameter, the parameter estimation method, the value of the test statistic, the bootstrap p value, the values of the estimators, and the number of bootstrap iterations:
$Test
the name of the used test statistic.
$parameter
the value of the tuning parameter.
$est.method
the estimation method used.
$T.value
the value of the test statistic.
$p.value
the approximated p value.
$par.est
the estimated parameters.
$boot.run
number of bootstrap iterations.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2019) "New weighted -type tests for the inverse Gaussian distribution", arXiv:1910.14119. LINK
test.ABEV1(rmutil::rinvgauss(20,2,1),B=100)
test.ABEV1(rmutil::rinvgauss(20,2,1),B=100)
This function computes the goodness-of-fit test for the inverse Gaussian family due to Allison et al. (2019). Two different estimation procedures are implemented, namely the method of moment and the maximum likelihood method.
test.ABEV2(data, a = 10, meth = "MME", B = 500)
test.ABEV2(data, a = 10, meth = "MME", B = 500)
data |
a vector of positive numbers. |
a |
positive tuning parameter. |
meth |
method of estimation used. Possible values are |
B |
number of bootstrap iterations used to obtain p value. |
The test is of weighted type and uses a characterization of the distribution function of the inverse Gaussian distribution. The p value is obtained by a parametric bootstrap procedure.
a list containing the value of the name of the test statistic, the used tuning parameter, the parameter estimation method, the value of the test statistic, the bootstrap p value, the values of the estimators, and the number of bootstrap iterations:
$Test
the name of the used test statistic.
$parameter
the value of the tuning parameter.
$est.method
the estimation method used.
$T.value
the value of the test statistic.
$p.value
the approximated p value.
$par.est
the estimated parameters.
$boot.run
number of bootstrap iterations.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2019) "New weighted -type tests for the inverse Gaussian distribution", arXiv:1910.14119. LINK
test.ABEV2(rmutil::rinvgauss(20,2,1),B=100)
test.ABEV2(rmutil::rinvgauss(20,2,1),B=100)
This function computes the goodness-of-fit test for the inverse Gaussian family in the spirit of Anderson and Darling. Note that this tests the composite hypothesis of fit to the family of inverse Gaussian distributions, i.e. a bootstrap procedure is implemented to perform the test.
test.AD(data, B = 500)
test.AD(data, B = 500)
data |
a vector of positive numbers. |
B |
number of bootstrap iterations used to obtain p value. |
The Anderson-Darling test is computed as described in Allison et. al. (2019). The p value is obtained by a parametric bootstrap procedure.
a list containing the value of the name of the test statistic, the value of the test statistic, the bootstrap p value, the values of the estimators, and the number of bootstrap iterations:
$Test
the name of the used test statistic.
$T.value
the value of the test statistic.
$p.value
the approximated p value.
$par.est
the estimated parameters.
$boot.run
number of bootstrap iterations.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2019) "New weighted -type tests for the inverse Gaussian distribution", arXiv:1910.14119. LINK
test.AD(rmutil::rinvgauss(20,2,1),B=100)
test.AD(rmutil::rinvgauss(20,2,1),B=100)
This function computes the goodness-of-fit test for the inverse Gaussian family due to Baringhaus and Gaigall (2015).
test.BG(data, B)
test.BG(data, B)
data |
a vector of positive numbers. |
B |
number of bootstrap iterations used to obtain p value. |
a list containing the value of the name of the test statistic, the used tuning parameter, the parameter estimation method, the value of the test statistic, the bootstrap p value, the values of the estimators, and the number of bootstrap iterations:
$Test
the name of the used test statistic.
$T.value
the value of the test statistic.
$p.value
the approximated p value.
$par.est
the estimated parameters.
$boot.run
number of bootstrap iterations.
Baringhaus, L. Gaigall, D. (2015). "On an independence test approach to the goodness-of-fit problem", Journal of Multivariate Analysis, 140, 193-208. doi:10.1016/j.jmva.2015.05.013
test.BG(rmutil::rinvgauss(20,2,1),B=100)
test.BG(rmutil::rinvgauss(20,2,1),B=100)
This function computes the goodness-of-fit test for the inverse Gaussian family in the spirit of Cramer and von Mises. Note that this tests the composite hypothesis of fit to the family of inverse Gaussian distributions, i.e. a bootstrap procedure is implemented to perform the test.
test.CM(data, B = 500)
test.CM(data, B = 500)
data |
a vector of positive numbers. |
B |
number of bootstrap iterations used to obtain p value. |
The Cramer-von Mises test is computed as described in Allison et. al. (2019). The p value is obtained by a parametric bootstrap procedure.
a list containing the value of the name of the test statistic, the value of the test statistic, the bootstrap p value, the values of the estimators, and the number of bootstrap iterations:
$Test
the name of the used test statistic.
$T.value
the value of the test statistic.
$p.value
the approximated p value.
$par.est
the estimated parameters.
$boot.run
number of bootstrap iterations.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2019) "New weighted -type tests for the inverse Gaussian distribution", arXiv:1910.14119. LINK
test.CM(rmutil::rinvgauss(20,2,1),B=100)
test.CM(rmutil::rinvgauss(20,2,1),B=100)
This function computes the goodness-of-fit test for the inverse Gaussian family due to Henze and Klar (2002).
test.HK1(data, a = 0, B = 500)
test.HK1(data, a = 0, B = 500)
data |
a vector of positive numbers. |
a |
positive tuning parameter. |
B |
number of bootstrap iterations used to obtain p value. |
The test statistics is a weighted integral over the squared modulus of some measure of deviation of the empirical distribution of given data from the family of inverse Gaussian laws, expressed by means of the empirical Laplace transform.
a list containing the value of the name of the test statistic, the used tuning parameter, the parameter estimation method, the value of the test statistic, the bootstrap p value, the values of the estimators, and the number of bootstrap iterations:
$Test
the name of the used test statistic.
$parameter
the value of the tuning parameter.
$T.value
the value of the test statistic.
$p.value
the approximated p value.
$par.est
the estimated parameters.
$boot.run
number of bootstrap iterations.
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
test.HK1(rmutil::rinvgauss(20,2,1),B=100)
test.HK1(rmutil::rinvgauss(20,2,1),B=100)
This function computes the goodness-of-fit test for the inverse Gaussian family due to Henze and Klar (2002).
test.HK2(data, B)
test.HK2(data, B)
data |
a vector of positive numbers. |
B |
number of bootstrap iterations used to obtain p value. |
The test statistic is a weighted integral over the squared modulus of some measure of deviation of the empirical distribution of given data from the family of inverse Gaussian laws, expressed by means of the empirical Laplace transform.
a list containing the value of the name of the test statistic, the used tuning parameter, the parameter estimation method, the value of the test statistic, the bootstrap p value, the values of the estimators, and the number of bootstrap iterations:
$Test
the name of the used test statistic.
$T.value
the value of the test statistic.
$p.value
the approximated p value.
$par.est
the estimated parameters.
$boot.run
number of bootstrap iterations.
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
test.HK2(rmutil::rinvgauss(20,2,1),B=100)
test.HK2(rmutil::rinvgauss(20,2,1),B=100)
This function computes the goodness-of-fit test for the inverse Gaussian family in the spirit of Kolmogorov and Smirnov. Note that this tests the composite hypothesis of fit to the family of inverse Gaussian distributions, i.e. a bootstrap procedure is implemented to perform the test.
test.KS(data, B = 500)
test.KS(data, B = 500)
data |
a vector of positive numbers. |
B |
number of bootstrap iterations used to obtain p value. |
The Kolmogorov Smirnov test is computed as described in Allison et. al. (2019). The p value is obtained by a parametric bootstrap procedure.
a list containing the value of the name of the test statistic, the value of the test statistic, the bootstrap p value, the values of the estimators, and the number of bootstrap iterations:
$Test
the name of the used test statistic.
$T.value
the value of the test statistic.
$p.value
the approximated p value.
$par.est
the estimated parameters.
$boot.run
number of bootstrap iterations.
Allison, J.S., Betsch, S., Ebner, B., Visagie, I.J.H. (2019) "New weighted -type tests for the inverse Gaussian distribution", arXiv:1910.14119. LINK
test.KS(rmutil::rinvgauss(20,2,1),B=100)
test.KS(rmutil::rinvgauss(20,2,1),B=100)