bw.mse.pdf.asym: Find asymptotically optimal bandwidth for KDE by minimizing...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Find asymptotically optimal bandwidth for Gaussian kernel density estimation by minimizing mean squared error at the first data point.

Usage

1
bw.mse.pdf.asym(x,iter.max=1L,eps=1e-6,start.bw=bw.nrd, verbose=FALSE)

Arguments

x

A numeric vector whose density is to be estimated.

iter.max

The max number of iterations. For an iterative procedure, set this to be greater than 1L.

eps

A small positive number such that iterations are terminated when the difference between successive bandwidths is below eps.

start.bw

A function, a character, or a positive number. If being a function or a character, the corresponding function will be called with x as the only argument to get the initial bandwidth. When it is a number, it will be used as the starting bandwidth directly.

verbose

Logical, when TRUE, the bandwidth for each iteration will be printed.

Details

The procedure starts from the starting bandwidth specified by start.bw. The new bandwidth will be computed as

( {Rf(x_1)} / [N{f''(x_1)}^2] )^{1/5}

where R is approximately 0.2821, N is the sample size and f is the density estimate using the current bandwidth.

Value

A numeric positive scalar, giving the final bandwidth.

Author(s)

Long Qu

References

Parzen, E. (1962). On Estimation of a Probability Density Function and Mode. The Annals of Mathematical Statistics 33: 1065–1076.

Scott, D. W. (1992). Multivariate Density Estimation: Theory, Practice, and Visualization. Wiley, New York.

Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing. Chapman and Hall, London.

See Also

density, kdde

Examples

1
2
3
4
5
6
7
8
9
set.seed(23490)
x=rnorm(100)
bw.mse.pdf.asym(x)
## Not run: 
plot(density(x, bw.mse.pdf.asym(x)), ylim=c(0,dnorm(0)))
abline(v=x[1L])
curve(dnorm, lty=3, col='grey', add=TRUE)

## End(Not run)

MRPP documentation built on May 2, 2019, 4:46 p.m.