Title: | Powerful Goodness-of-Fit Tests Based on the Likelihood Ratio |
---|---|
Description: | Provides new types of omnibus tests which are generally much more powerful than traditional tests (including the Kolmogorov-Smirnov, Cramer-von Mises and Anderson-Darling tests),see Zhang (2002) <doi:10.1111/1467-9868.00337>. |
Authors: | Ning Cui [aut, cre], Maoyuan Zhou [ctb] |
Maintainer: | Ning Cui <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.1 |
Built: | 2024-10-24 03:12:33 UTC |
Source: | https://github.com/cran/DistributionTest |
The new statistics ZA appear similar to the Anderson-Darling, but it's generally much more powerful,see Jin Zhang(2002).
za.test(x, y, para = NULL, N = 1000)
za.test(x, y, para = NULL, N = 1000)
x |
a numeric vector of data values, the number of which must be greater than 7. Missing values are allowed. |
y |
When tested as a single sample, a numeric vector of data values, the number of which must be greater than 7. Missing values are allowed. When tested as two-sample, a character string indicating what type of test was performed. Distributions "unif", "exponential", "normal", "lognormal", "gamma","t" and "weibull" are recognised.Here,the names of "exponential", "normal" and "lognormal" are simplified as "exp" ,"norm" and "lognorm" respectively. |
para |
A named list giving the parameters of the distribution specified and this can be omitted. |
N |
The number of replications in Monte Carlo simulation.The default value is 1000 |
The ZA test is an EDF omnibus test for the composite hypothesis of distribution. The test statistic is
where is a hypothesized distribution function to be tested.Here,
,
is the cumulative distribution function of the specificed distribution.The p-value is computed by Monte Carlo simulation.
A list with class “htest” containing the following components:
statistic |
the value of the ZA statistic. |
p.value |
the p-value for the test. |
method |
the character string “ZA test for given distribution”. |
data.name |
a character string giving the name(s) of the data. |
The Za test is the recommended EDF test by Jin Zhang.
Ning Cui
Jin Zhang: Goodness-of-Fit Tests Based on the Likelihood Ratio.Journal of the Royal Statistical Society,64,281-294.
Jin Zhang,Yuehua Wu: Likelihood-ratio tests for normality.Computational Statistics & Data Analysis,49,709-721.
Jin Zhang: Powerful Two-Sample Tests Based on the Likelihood Ratio. Technometrics, 48:1, 95-103.
ks.test
for performing a one- or two-sample Kolmogorov-Smirnov test.
zc.test
,zk.test
for performing a powerful goodness-of-fit test based on the likelihood ratio.
x<-rbeta(50,shape1 = 0.6,shape2 = 0.8) y<-rnorm(50) za.test(x,y) za.test(x,"unif") za.test(x,"norm") za.test(x,"unif",para = list(min=1,max=2)) za.test(x,"exp",para = list(rate=1)) za.test(x,"norm",para = list(mean=1,sd=2)) za.test(x,"lognorm",para = list(mean=1,sd=2)) za.test(x,"weibull",para = list(shape=1,scale=2)) za.test(x,"gamma",para = list(shape=2,scale=1)) za.test(x,"t",para = list(df=3))
x<-rbeta(50,shape1 = 0.6,shape2 = 0.8) y<-rnorm(50) za.test(x,y) za.test(x,"unif") za.test(x,"norm") za.test(x,"unif",para = list(min=1,max=2)) za.test(x,"exp",para = list(rate=1)) za.test(x,"norm",para = list(mean=1,sd=2)) za.test(x,"lognorm",para = list(mean=1,sd=2)) za.test(x,"weibull",para = list(shape=1,scale=2)) za.test(x,"gamma",para = list(shape=2,scale=1)) za.test(x,"t",para = list(df=3))
The new statistics ZC appear similar to the Cramer-von Mises statistic, but it's generally much more powerful,see Jin Zhang(2002).
zc.test(x, y, para = NULL, N = 1000)
zc.test(x, y, para = NULL, N = 1000)
x |
a numeric vector of data values, the number of which must be greater than 7. Missing values are allowed. |
y |
When tested as a single sample, a numeric vector of data values, the number of which must be greater than 7. Missing values are allowed. When tested as two-sample, a character string indicating what type of test was performed. Distributions "unif", "exponential", "normal", "lognormal", "gamma","t" and "weibull" are recognised.Here,the names of "exponential", "normal" and "lognormal" are simplified as "exp" ,"norm" and "lognorm" respectively. |
para |
A named list giving the parameters of the distribution specified and this can be omitted. |
N |
The number of replications in Monte Carlo simulation.The default value is 1000 |
The ZC test is an EDF omnibus test for the composite hypothesis of distribution. The test statistic is
where is a hypothesized distribution function to be tested.Here,
,
is the cumulative distribution function of the specificed distribution.The p-value is computed by Monte Carlo simulation.
A list with class “htest” containing the following components:
statistic |
the value of the ZC statistic. |
p.value |
the p-value for the test. |
method |
the character string “ZC test for given distribution”. |
data.name |
a character string giving the name(s) of the data. |
The ZC test is the recommended EDF test by Jin Zhang.
Ning Cui
Jin Zhang: Goodness-of-Fit Tests Based on the Likelihood Ratio.Journal of the Royal Statistical Society,64,281-294.
Jin Zhang,Yuehua Wu: Likelihood-ratio tests for normality.Computational Statistics & Data Analysis,49,709-721.
Jin Zhang: Powerful Two-Sample Tests Based on the Likelihood Ratio. Technometrics, 48:1, 95-103.
ks.test
for performing a one- or two-sample Kolmogorov-Smirnov test.
za.test
,zk.test
for performing a powerful goodness-of-fit test based on the likelihood ratio.
x<-rbeta(50,shape1 = 0.6,shape2 = 0.8) y<-rnorm(50) zc.test(x,y) zc.test(x,"unif") zc.test(x,"norm") zc.test(x,"unif",para = list(min=1,max=2)) zc.test(x,"exp",para = list(rate=1)) zc.test(x,"norm",para = list(mean=1,sd=2)) zc.test(x,"lognorm",para = list(mean=1,sd=2)) zc.test(x,"weibull",para = list(shape=1,scale=2)) zc.test(x,"gamma",para = list(shape=2,scale=1)) zc.test(x,"t",para = list(df=3))
x<-rbeta(50,shape1 = 0.6,shape2 = 0.8) y<-rnorm(50) zc.test(x,y) zc.test(x,"unif") zc.test(x,"norm") zc.test(x,"unif",para = list(min=1,max=2)) zc.test(x,"exp",para = list(rate=1)) zc.test(x,"norm",para = list(mean=1,sd=2)) zc.test(x,"lognorm",para = list(mean=1,sd=2)) zc.test(x,"weibull",para = list(shape=1,scale=2)) zc.test(x,"gamma",para = list(shape=2,scale=1)) zc.test(x,"t",para = list(df=3))
The new statistics ZK appear similar to the Kolmogorov-Smirnov statistic, but it's generally much more powerful,see Jin Zhang(2002).
zk.test(x, y, para = NULL, N = 1000)
zk.test(x, y, para = NULL, N = 1000)
x |
a numeric vector of data values, the number of which must be greater than 7. Missing values are allowed. |
y |
When tested as a single sample, a numeric vector of data values, the number of which must be greater than 7. Missing values are allowed. When tested as two-sample, a character string indicating what type of test was performed. Distributions "unif", "exponential", "normal", "lognormal", "gamma","t" and "weibull" are recognised.Here,the names of "exponential", "normal" and "lognormal" are simplified as "exp" ,"norm" and "lognorm" respectively. |
para |
A named list giving the parameters of the distribution specified and this can be omitted. |
N |
The number of replications in Monte Carlo simulation.The default value is 1000 |
The Zk test is an EDF omnibus test for the composite hypothesis of distribution. The test statistic is
where is a hypothesized distribution function to be tested.Here,
,
is the cumulative distribution function of the specificed distribution.The p-value is computed by Monte Carlo simulation.
A list with class “htest” containing the following components:
statistic |
the value of the ZK statistic. |
p.value |
the p-value for the test. |
method |
the character string “ZK test for given distribution”. |
data.name |
a character string giving the name(s) of the data. |
The Zk test is the recommended EDF test by Jin Zhang.
Ning Cui
Jin Zhang: Goodness-of-Fit Tests Based on the Likelihood Ratio.Journal of the Royal Statistical Society,64,281-294.
Jin Zhang,Yuehua Wu: Likelihood-ratio tests for normality.Computational Statistics & Data Analysis,49,709-721.
Jin Zhang: Powerful Two-Sample Tests Based on the Likelihood Ratio. Technometrics, 48:1, 95-103.
ks.test
for performing a one- or two-sample Kolmogorov-Smirnov test.
zc.test
,za.test
for performing a powerful goodness-of-fit test based on the likelihood ratio.
x<-rbeta(50,shape1 = 0.6,shape2 = 0.8) y<-rnorm(50) zk.test(x,y) zk.test(x,"unif") zk.test(x,"norm") zk.test(x,"unif",para = list(min=1,max=2)) zk.test(x,"exp",para = list(rate=1)) zk.test(x,"norm",para = list(mean=1,sd=2)) zk.test(x,"lognorm",para = list(mean=1,sd=2)) zk.test(x,"weibull",para = list(shape=1,scale=2)) zk.test(x,"gamma",para = list(shape=2,scale=1)) zk.test(x,"t",para = list(df=3))
x<-rbeta(50,shape1 = 0.6,shape2 = 0.8) y<-rnorm(50) zk.test(x,y) zk.test(x,"unif") zk.test(x,"norm") zk.test(x,"unif",para = list(min=1,max=2)) zk.test(x,"exp",para = list(rate=1)) zk.test(x,"norm",para = list(mean=1,sd=2)) zk.test(x,"lognorm",para = list(mean=1,sd=2)) zk.test(x,"weibull",para = list(shape=1,scale=2)) zk.test(x,"gamma",para = list(shape=2,scale=1)) zk.test(x,"t",para = list(df=3))