Open rb792-EcoEvo opened 6 years ago
Greetings,
The normal-reference rule is included (bwmethod="normal-reference") but base R has a number of plug-in methods for univariate density estimation that can be called, e.g., bws=bw.nrd0(x) etc. See ?bw.nrd for details (and the np FAQ)...
Jeff
Dear Jeff, I'm aware of the implementations for density estimation, but was wondering about regression estimation, for which I'm working with "npregbw" (which only accepts bwmethod = "cv.ls" and "cv.aic"). Or is there an obvious way to use the plug-in methods that are implemented for density estimation to estimate bandwidths for regressions? Many thanks, Robert
Hi,
For regression there is the function dpill()
in the KernSmooth
package ("Use direct plug-in methodology to select the bandwidth of a local linear Gaussian kernel regression estimate, as described by Ruppert, Sheather and Wand (1995).")
Perhaps this will work? It is univariate only though...
Jeff
Thanks, and sorry, I should have specified this at the start, I'm dealing with a multivariate problem, ~5 predictors of length ~20,000 each, which makes cross-validation a bit tricky...
In that case, try a bounded support kernel function, turn on the tree option (see FAQ) and you can also run the snippet of code in the FAQ that indicates likely run-time...
Jeff
Would it be possible to implement the plug-in method (rule of thumb), that is used in bandwidth estimation for densities, in the function "npregbw" as well?