md: md selects bandwidth for kernel density estimator with...

Description Usage Arguments Value Examples

View source: R/minimumDistanceMethod.R

Description

md selects bandwidth for kernel density estimator with minimum distance method. Minimum distance method directly selects optimal kernel density estimator in countably infinite kernel density estimators and indirectly selects optimal bandwidth. md selects optimal bandwidth in countably finite kernel density estimators.

Usage

1
md(data,hnumber,ds)

Arguments

data

data sample

hnumber

the number of bandwidth which md can select. 60 is enough. Of course, you can take it more.

ds

rate of data split. Minimum distance method has to split data for constructing kernel density estimators and empirical measures.

Value

bandwidth

Examples

1
2
3
4
5
6
7
8
# select bandwidth
md(runif(100),20,0.6)

# select bandwidth and plot
data <- rnorm(100)
bandwidth <- md(data,20,0.6)
x <- seq(min(data),max(data),length=100)
plot(x,sapply(x,fhat,bandwidth,data),type="l",ylab="density")

md documentation built on May 2, 2019, 1:02 a.m.

Related to md in md...