cv {sm} | R Documentation |
This function computes a cross-validatory criterion, based on integrated squared error, for use in selecting a smoothing parameter in nonparametric density estimation.
cv(x, h, ...)
x |
vector, or two-column matrix, of data. |
h |
a smoothing parameter. In the two-dimensional case this is multiplied by the standard deviation of each component to produce two smoothing parameters |
... |
other optional parameters are passed to the sm.options function, through
a mechanism which limits their effect only to this call of the function;
those relevant for this function are the following:
|
See Section 2.4.3 of the reference below. The function is called
automatically by hcv
and does not usually need to be called
independently.
The value of the cross-validatory criterion.
Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with S-Plus Illustrations. Oxford University Press, Oxford.
x <- rnorm(50) hgrid <- seq(0.1, 1, length = 10) cvgrid <- vector("numeric", length = length(hgrid)) for (i in 1:10) cvgrid[i] <- cv(x, hgrid[i]) plot(hgrid, cvgrid, type="l")