Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

h.norm

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

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

Examples

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))

pdfCluster

Cluster Analysis via Nonparametric Density Estimation

v1.0-3
GPL-2
Authors
Adelchi Azzalini, Giovanna Menardi for the current version; Adelchi Azzalini, Giovanna Menardi and Tiziana Rosolin up to version 0.1-13.
Initial release
2018-12-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.