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

Macro: denbwcrit
Description: determines the optimal from a range of bandwidths by 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", "bcv", "scv", "jmp", "pm", "sj".
x n x 1 vector, the data.
h m x 1 vector, vector of bandwidths.
K string, kernel function on [-1,1] or Gaussian kernel "gau". If not given, "gau" is used.
d 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 h range.)
ch m x 2 vector, the criterion function for h values.

Note:

Example:
library("smoother")
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:
hopt is the LSCV optimal bandwidth for these data.
The resulting curve for the LSCV criterion is plotted.

Library: smoother
See also: denbwsel denrot denest

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

Author: Marco Bianchi & Sigbert Klinke, 930722; Lijian Yang, 961026; Marlene Mueller 990413
(C) MD*TECH Method and Data Technologies, 28.6.1999