kde.test(x1, x2, H1, H2, h1, h2, psi1, psi2, var.fhat1, var.fhat2,
binned=FALSE, bgridsize, verbose=FALSE, pilot="dscalar")
Hpi.kfe(x, nstage=2, pilot="dscalar", pre="sphere", Hstart, binned=FALSE,
bgridsize, amise=FALSE, deriv.order=0, verbose=FALSE, optim.fun="nlm")
hpi.kfe(x, nstage=2, binned=FALSE, bgridsize, amise=FALSE, deriv.order=0)Hpi.kfe, hpi.kfe is called by default.pre.scale, "sphere" = pre.spherekde.test(,binned=TRUE) invokes binned estimation for
the computation of the bandwidth selectors, and not the test statistic and
p-value. --Hpi.kfe is the optimal plug-in bandwidth for $r$-th order kernel functional estimator
based on the unconstrained pilot selectors of Chacon & Duong (2010).
hpi.kfe is the 1-d equivalent, using the formulas from
Wand & Jones (1995, p.70). If H1,H2 are missing then the binned
2-stage plug-in selector Hpi.kfe(, nstage=2, binned=TRUE) is automatically
called by kde.test to estimate the functionals with kfe(, deriv.order=0). Likewise for missing h1,h2.
Duong, T., Goud, B. & Schauer, K. (2012) Closed-form density-based framework for automatic detection of cellular morphology changes. PNAS, 109, 8382-8387.
Wand, M.P. & Jones, M.C. (1995) Kernel Smoothing. Chapman & Hall/CRC, London.
kde.local.testset.seed(8192)
samp <- 1000
x <- rnorm.mixt(n=samp, mus=0, sigmas=1, props=1)
y <- rnorm.mixt(n=samp, mus=0, sigmas=1, props=1)
kde.test(x1=x, x2=y)$pvalue ## accept H0: f1=f2
library(MASS)
data(crabs)
x1 <- crabs[crabs$sp=="B", c(4,6)]
x2 <- crabs[crabs$sp=="O", c(4,6)]
kde.test(x1=x1, x2=x2)$pvalue ## reject H0: f1=f2Run the code above in your browser using DataLab