hprop2f {pdfCluster} | R Documentation |
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 |
alpha |
Sensitivity parameter satysfying |
kernel |
Kernel to be used to compute the pilot density estimate. It should be one of
"gaussian" or "t7". See |
Details
A vector of smoothing parameters is chosen for each sample point
, as follows:
where is a pilot kernel density estimate of the density function
, with vector of bandwidths
h
,
and is the geometric mean of
,
.
See Section 5.3.1 of the reference below.
Value
Returns a matrix with the same dimensions of x
where row provides
the vector of smoothing parameters for sample point
.
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))