ddst.exp.test(x, base = ddst.base.legendre, c = 100, B = 1000, compute.p = F, Dmax = 5, ...)
ddst.base.legendre
for Legendre polynomials or ddst.base.cos
for cosine system, see package description. htest
compute.p=T
.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 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