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

hprop2f

Sample smoothing parameters in adaptive density estimation


Description

This function computes the sample smoothing parameters to be used in adaptive kernel density estimation, according to Silverman (1986).

Usage

hprop2f(x, h = h.norm(x), alpha = 1/2, kernel = "gaussian")

Arguments

x

Vector or matrix of data.

h

Vector of smoothing parameters to be used to get a pilot estimate of the density function. It has length equal to NCOL(x).

alpha

Sensitivity parameter satysfying 0 ≤q α ≤q 1, giving the power to which raise the pilot density. Default value is 1/2. See details.

kernel

Kernel to be used to compute the pilot density estimate. It should be one of "gaussian" or "t7". See kepdf for further details.

Details

A vector of smoothing parameters h_{i} is chosen for each sample point x_i, as follows:

h_i = h ≤ft(\frac{\hat{f}_h(x_i)}{g}\right)^{- α }

where \hat{f}_h is a pilot kernel density estimate of the density function f, with vector of bandwidths h, and g is the geometric mean of \hat{f}_h(x_i), i=1, ..., n. See Section 5.3.1 of the reference below.

Value

Returns a matrix with the same dimensions of x where row i provides the vector of smoothing parameters for sample point x_i.

References

Silverman, B. (1986). Density estimation for statistics and data analysis. Chapman and Hall, London.

See Also

h.norm

Examples

set.seed(123)
x <- rnorm(10)

sm.par <- hprop2f(x)
pdf <- kepdf(x, bwtype= "adaptive")

pdf@par$hx
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.