Learn R Programming

sm (version 2.0-2)

sj: Sheather-Jones criterion for nonparametric density estimation

Description

This function computes a criterion associated with the Sheather-Jones plug-in method of selecting a smoothing parameter in nonparametric density estimation. The selected smoothing parameter is identified by the point at which this criterion takes the value 0.

Usage

sj(x, h)

Arguments

x
a vector of data.
h
a value of smoothing parameter.

Value

  • The value of the Sheather-Jones criterion.

Details

see Section 2.4.4 of the reference below. The function is called automatically by hsj and does not usually need to be called independently.

References

Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with S-Plus Illustrations. Oxford University Press, Oxford.

See Also

cv, hcv, hsj, hnorm

Examples

Run this code
x      <- rnorm(50)
hgrid  <- seq(0.1, 1, length = 10)
sjgrid <- vector("numeric", length = length(hgrid))
for (i in 1:10) sjgrid[i] <- sj(x, hgrid[i])
plot(hgrid, sjgrid, type="l")
abline(0, 0, lty=2)

Run the code above in your browser using DataLab