bwadap.numeric {iosmooth} | R Documentation |
Adaptive bandwidth choice for infinite order density estimates
Description
Adaptive bandwidth choice for infinite order flat-top kernel density estimates.
Usage
## S3 method for class 'numeric'
bwadap(x, smax = 13.49/IQR(x), n.points = 1000, Kn = 1.349 *
5/IQR(x), c.thresh = 2, ...)
Arguments
x |
A univariate data set. |
smax |
The algorithm searches for smoothing parameters on the interval |
n.points |
The number of points in |
Kn |
Tuning parameter |
c.thresh |
The bandwidth is chosen by looking for the first time the sample characteristic function drops below |
... |
Currently unimplemented. |
Details
Returns a bandwidth, h
, for use with infinite order flat-top kernel density estimates. All frequencies higher than 1/h
are downweighted by the kernel. All kernels in this package are scaled to use roughly the same bandwidth. We recommend using this algorithm in conjunction with bwplot.numeric
to double check the automated selection.
Value
Returns the estimated kernel bandwidth h.
Author(s)
Timothy L. McMurry
References
Politis, D. N. (2003). Adaptive bandwidth choice. Journal of Nonparametric Statistics, 15(4-5), 517-533.
See Also
bwadap
, bwadap.ts
, bwplot.numeric
, bwplot
Examples
x <- rnorm(100)
bwplot(x)
h <- bwadap(x)
plot(iodensity(x, h, kernel="Trap"), type="l")
rug(x)
# Add the truth in red
xs <- seq(-3, 3, len=1000)
lines(xs, dnorm(xs), col="red")