View source: R/hopt.edgeworth.R
hopt.edgeworth | R Documentation |
S.n
.Implements the power-optimal bandwidth for density goodness-of-fit test S.n
based on optimization of the test statistic's power function.
hopt.edgeworth(xin, dist, kfun, p1, p2, sig.lev)
xin |
A vector of data points - the available sample. |
dist |
The null distribution. |
kfun |
The kernel to use in the density estimates used in the bandwidth expression. |
p1 |
Parameter 1 (vector or object) for the null distribution. |
p2 |
Parameter 2 (vector or object) for the null distribution. |
sig.lev |
Significance level of the hypothesis test. |
Implements: the power-optimal bandwidth for the test statistic S.n
given by
h = ≤ft \{ \frac{√{2} K^{(3)}(0)}{3R(K)^{3/2}} \frac{ν_2}{R(f)^{3/2}}\right \}^{-1/2} ≤ft \{ \frac{n \int Δ_n^2 (x) f^2(x)\,dx}{σ^2 \{ 2 ν_2 R(K)\}^{1/2}} \right \}^{-3/2}.
This bandwidth rule is the density function equivalent bandwidth rule obtained in the closely relatated regression setting in Gao and Gijbels (2008) and is designed to optimize the test's power subject to keeping the size contant.
A scalar, the estimate the power-optimal bandwidth.
Dimitrios Bagkavos
R implementation and documentation: Dimitrios Bagkavos <dimitrios.bagkavos@gmail.com>
Gao and Gijbels, Bandwidth selection in nonparametric kernel testing, pp. 1584-1594, JASA (2008)
hopt.be
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.