Normal optimal choice of smoothing parameter in density estimation

Description

This function computes the smoothing parameter to be used in kernel density estimation, as asymptotically optimal when the underlying distribution is Normal. Unidimensional as well as multidimensional data can be handled. When multidimensional data are supplied, a vector of smoothing parameters is computed having one element for each component.

Usage

1
h.norm(x)

Arguments

x

vector, matrix or data-frame of data.

Details

The smoothing parameter of component j of a n\times d data matrix is estimated as follows:

σ_j{≤ft(\frac{4}{(d+2)n }\right)}^{\frac{1}{d+4}}

where σ_j is the estimated standard deviation of component j. See Section 2.4.2 of the reference below.

Value

Returns a numeric vector with the same length as the number of columns of x or with length one if x is a vector. When x is a matrix, a vector of smoothing parameters is provided having one element for each component.

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

hnorm

Examples

1
2
3
4
5
set.seed(123)
x <- rnorm(30)
sm.par <- h.norm(x)
pdf <- kepdf(x, bwtype= "fixed", h = sm.par)
plot(pdf, eval.points=seq(-4,4,by=.2))