Normal optimal choice of smoothing parameter in density estimation
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.
h.norm(x)
x |
vector, matrix or data-frame of data. |
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.
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.
Bowman, A.W. and Azzalini, A. (1997). Applied smoothing techniques for data analysis: the kernel approach with S-Plus illustrations. Oxford University Press, Oxford.
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))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.