Description Usage Arguments Details Value Author(s) References See Also Examples
Performs Vasicek-Song goodness-of-fit test to the specified distribution family.
1 2 3 |
x |
( |
densfun |
A character string specifying the fitted distribution. Possible values are |
param |
( |
simulate.p.value |
( |
B |
( |
delta |
( |
extend |
( |
relax |
( |
The test statistic is
I_{mn}=-V_{mn}-\frac{1}{n}∑_{i=1}^{n}\log p_{0}(X_{i},θ),
where V_{mn} is the Vasicek estimator of Shannon entropy computed from the numeric sample x
with window size m and p_{0}(x,θ) is the density function of the specified distribution densfun
to be tested, with θ the parameter of the null for a simple hypothesis or its maximum likelihood estimate for a composite null hypothesis (param=NULL
); See Song (2002), Girardin and Lequesne (2017) and Lequesne and Regnault (2018).
An optimal window size m is automatically computed; see Song (2002).
An exact p-value is computed if the sample size is less than 100. Otherwise, asymptotic distribution is used whose approximation may be inaccurate for small samples; see Lequesne and Regnault (2018).
A list with class "htest" containing the following components:
observed |
The sample under study. |
data.name |
The name (as an R object) of the sample. |
null.value |
A character string specifying the name of the fitted distribution. |
method |
The character string |
statistic |
Vasicek test statistic; see Details below. |
parameter |
The optimal window for Vasicek test statistic |
estimate |
Parameter(s) of the fitted distribution. If |
p.value |
The p-value of the test. |
J. Lequesne justine.lequesne@unicaen.fr
Vasicek, O., A test for normality based on sample entropy, Journal of the Royal Statistical Society, 38(1), 54-59 (1976).
Song, K. S., Goodness-of-fit tests based on Kullback-Leibler discrimination information, Information Theory, IEEE Transactions on, 48(5), 1103-1117 (2002).
Girardin, V., Lequesne, J. Entropy-based goodness-of-fit tests - a unifying framework. Application to DNA replication. Communications in Statistics: Theory and Methods (2017). https://doi.org/10.1080/03610926.2017.1401084
Lequesne, J., Regnault, P. vsgoftest: An R Package for Goodness-of-Fit Testing Based on Kullback-Leibler Divergence. Journal of Statistical Software, 96 (2020). doi:10.18637/jss.v096.c01
entropy.estimate
which computes the Vasicek estimator of Shannon entropy.
1 2 3 4 5 6 | set.seed(1)
samp <- rnorm(50,2,3)
vs.test(x = samp, densfun = 'dnorm', param = c(2,3), B = 500) #Simple null hypothesis
vs.test(x = samp, densfun='dnorm', B = 500) #Composite null hypothesis
## Using asymptotic distribution to compute the p-value
vs.test(x = samp, densfun='dnorm', simulate.p.value = FALSE) #Composite null hypothesis
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.