h.select {sm}  R Documentation 
This function selects a smoothing parameter for density estimation in one or two dimensions and for nonparametric regression with one or two covariates. Several methods of selection are available.
h.select(x, y = NA, weights = NA, group = NA, ...)
x 
a vector, or twocolumn matrix. 
y 
a vector of reponses, in regression case. 
weights 
a vector of integers representing frequencies of individual
observations. Use of this parameter is incompatible with

group 
a vector of groups indicators (numeric or character values) or a factor 
... 
other optional parameters are passed to the 
see the two references below for discussion of the methods of smoothing parameter selection.
If the sample size is large, binning will be employed. In the
case of method = "cv"
the answer will therefore be
different from that obtained through the function hcv
where binning is not used.
When the group
argument is set, the chosen method of
smoothing parameter selection is applied to each group and the
value returned is the geometric mean of these. This is intended
for use in sm.density.compare
and
sm.ancova
, where
the same smoothing parameter is used for all groups so that
the principal bias terms cancel when the estimates are compared.
the value of the selected smoothing parameter.
none
Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with SPlus Illustrations. Oxford University Press, Oxford.
Hurvich, C.M., Simonoff, J.S. and Tsai, C.L. (1998). Smoothing parameter selection in nonparametric regression using an improved Akaike information criterion. J. R. Statistic. Soc., Series B, 60, 271293.
x < rnorm(50) h.select(x) h.select(x, method = "sj") x < matrix(rnorm(100), ncol = 2) h.select(x) sm.density(x, method = "cv") x < rnorm(50) y < x^2 + rnorm(50) h.select(x, y) sm.regression(x, y, method = "aicc") x < matrix(rnorm(100), ncol = 2) y < x[,1]^2 + x[,2]^2 + rnorm(50) h.select(x, y, method = "cv", structure.2d = "common") sm.regression(x, y, df = 8)