ddst.norm.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
.We model alternatives similarly as in Kallenberg and Ledwina (1997 a,b) using Legendre's polynomials or cosine basis. The parameter $gamma=(gamma_1,gamma_2)$ is estimated by $tilde gamma=(tilde gamma_1,tilde gamma_2)$, where $tilde gamma_1=1/n sum_i=1^n Z_i$ and $tilde gamma_2 = 1/(n-1) sum_i=1^n-1(Z_n:i+1-Z_n:i)(H_i+1-H_i)$, while $Z_n:1<= ...="" <="Z_n:n$ are ordered values of $Z_1, ..., Z_n$ and $H_i= phi^-1((i-3/8)(n+1/4))$, cf. Chen and Shapiro (1995). =>
The above yields auxiliary test statistic $W_k^*(tilde gamma)$ described in details in Janic and Ledwina (2008), in case when Legendre's basis is applied. The pertaining 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 is computed in a numerical way in case of cosine basis. In the implementation of $T^*$ the default value of c is set to be 100. Therefore, in practice, $T^*$ is Schwarz-type criterion. See Inglot and Ledwina (2006) as well as Janic and Ledwina (2008) for comments. The resulting data driven test statistic for normality is $W_T^*=W_T^*(tilde gamma)$.
For more details see: http://www.biecek.pl/R/ddst/description.pdf.
Inglot, T., Ledwina, T. (2006). Towards data driven selection of a penalty function for data driven Neyman tests. Linear Algebra and its Appl. 417, 579--590.
Janic, A. and Ledwina, T. (2008). Data-driven tests for a location-scale family revisited. J. Statist. Theory. Pract. Special issue on Modern Goodness of Fit Methods. accepted..
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.
# for given vector of 19 numbers
z = c(13.41, 6.04, 1.26, 3.67, -4.54, 2.92, 0.44, 12.93, 6.77, 10.09,
4.10, 4.04, -1.97, 2.17, -5.38, -7.30, 4.75, 5.63, 8.84)
ddst.norm.test(z, compute.p=TRUE)
# H0 is true
z = rnorm(80)
ddst.norm.test(z, compute.p=TRUE)
# H0 is false
z = rexp(80,4)
ddst.norm.test(z, B=5000, compute.p=TRUE)
Run the code above in your browser using DataLab