Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: smoother
See also: denbwsel denrot denest

Quantlet: denbwcrit
Description: determines from a range of bandwidths the optimal one using one of the following bandwidth selection criteria: Least Squares Cross Validation (lscv), Biased Cross Validation (bcv), Smoothed Cross Validation (scv), Jones, Marron and Park Cross Validation (jmp), Park and Marron Plug-in (pm), Sheather and Jones Plug-in (sj), and Silverman's rule of thumb.

Reference(s):

Usage: {hopt, ch} = denbwcrit(crit, x, h {,K} {,d} )
Input:
crit string, criterion for bandwidth selection: "lscv" = Least Squares Cross Validation, "bcv" = Biased Cross Validation, "scv" = Smoothed Cross Validation, "jmp" = Jones, Marron and Park Cross Validation, "pm" = Park and Marron Plug-in, "sj" = Sheather and Jones Plug-in
x n x 1 vector, the data.
h m x 1 vector of bandwidths.
K optional string representing the kernel function on [-1,1]; default = "gau".
d optional scalar, discretization binwidth. d must be smaller than h. If not given, the minimum of min(h)/3 and (max(x)-min(x))/200 is used.
Output:
hopt scalar, optimal bandwidth. (If negative in case of "pm" or "sj", denbwcrit needs to be run again with different range of h.)
ch m x 2 vector, the criterion function for h values.

Note:

Example:
library("smoother")
randomize(111)
x=normal(500)
h=grid(0.05,0.1,10)
{hopt,ch}=denbwcrit("lscv",x,h)
hopt
library("plot")
ch=setmask(ch,"line","blue")
plot(ch)
setgopt(plotdisplay,1,1,"title",string("hopt=%1.6g",hopt))

Result:
Contents of hopt
[1,]     0.35

hopt is the LSCV optimal bandwidth for these data.
The resulting curve for the LSCV criterion is plotted.



Author: M. Bianchi, S. Klinke, L. Yang, M. Mueller, 20020915 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006