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 [0, smax]. smax is problem dependent, and the defaults are not consistently appropriate.

n.points

The number of points in [0, smax] at which the algorithm looks for crossing of the threshold c.thresh*sqrt(log(n,10)/n). If the sample characteristic function is highly oscillatory on [0,smax], this may need to be increased.

Kn

Tuning parameter Kn discussed in Politis (2003). Roughly, the distance over which the sample characteristic function must stay below the threshold determined by c.thresh.

c.thresh

The bandwidth is chosen by looking for the first time the sample characteristic function drops below c.thresh*sqrt(log(n,10)/n) and stays below that level for a distance of Kn.

...

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

[Package iosmooth version 0.94 Index]