Performs data driven smooth test for composite hypothesis of exponentiality.
ddst.exp.test(x, base = ddst.base.legendre, c = 100, B = 1000, compute.p = F,
Dmax = 5, ...)An object of class htest
the value of the test statistic.
the number of choosen coordinates (k).
a character string indicating the parameters of performed test.
a character string giving the name(s) of the data.
the p-value for the test, computed only if compute.p=T.
a (non-empty) numeric vector of data values.
a function which returns orthogonal system, might be ddst.base.legendre for Legendre polynomials or ddst.base.cos for cosine system, see package description.
a parameter for model selection rule, see package description.
an integer specifying the number of replicates used in p-value computation.
a logical value indicating whether to compute a p-value.
an integer specifying the maximum number of coordinates, only for advanced users.
further arguments.
Przemyslaw Biecek and Teresa Ledwina
Null density is given by $f(z;gamma) = exp(-z/gamma)$ for z >= 0 and 0 otherwise.
Modelling alternatives similarly as in Kallenberg and Ledwina (1997 a,b), e.g., and estimating $gamma$ by $tilde gamma= 1/n sum_i=1^n Z_i$ yields the efficient score vector $l^*(Z_i;tilde gamma)=(phi_1(F(Z_i;tilde gamma)),...,phi_k(F(Z_i;tilde gamma)))$, where $phi_j$'s are jth degree orthonormal Legendre polynomials on [0,1] or cosine functions $sqrt(2) cos(pi j x), j>=1$, while $F(z;gamma)$ is the distribution function pertaining to $f(z;gamma)$.
The matrix $[I^*(tilde gamma)]^-1$ does not depend on $tilde gamma$ and is calculated for succeding dimensions k using some recurrent relations for Legendre's polynomials and computed in a numerical way in case of cosine basis. In the implementation the default value of c in $T^*$ is set to be 100.
Therefore, $T^*$ practically coincides with S1 considered in Kallenberg and Ledwina (1997 a).
For more details see: http://www.biecek.pl/R/ddst/description.pdf.
Kallenberg, W.C.M., Ledwina, T. (1997 a). Data driven smooth tests for composite hypotheses: Comparison of powers. J. Statist. Comput. Simul. 59, 101--121.
Kallenberg, W.C.M., Ledwina, T. (1997 b). Data driven smooth tests when the hypothesis is composite. J. Amer. Statist. Assoc. 92, 1094--1104.
# H0 is true
z = rexp(80,4)
ddst.exp.test (z, compute.p = TRUE)
# H0 is false
z = rchisq(80,4)
(t = ddst.exp.test (z, compute.p = TRUE))
t$p.value
Run the code above in your browser using DataLab