Learn R Programming

MKLE (version 1.0.1)

mkle: Maximum kernel likelihood estimation

Description

Computes the maximum kernel likelihood estimator for a given dataset and bandwidth.

Usage

mkle(data,bw=2*sd(data),kernel=c("gaussian", "epanechnikov", "rectangular", "triangular", 
     "biweight", "cosine", "optcosine"),gridsize=2^14)

Value

The maximum kernel likelihood estimator.

Arguments

data

the data for which the estimator should be found.

bw

the smoothing bandwidth to be used.

kernel

a character string giving the smoothing kernel to be used. This must be one of '"gaussian"', '"rectangular"', '"triangular"', '"epanechnikov"', '"biweight"', '"cosine"' or '"optcosine"', with default '"gaussian"'. May be abbreviated to a unique prefix (single letter).

gridsize

the number of points at which the kernel density estimator is to be evaluated with \(2^{14}\) as the default.

Author

Thomas Jaki

Details

The default for the bandwidth is \(2s\), which is the near-optimal value if a Gaussian kernel is used. If the bandwidth is zero, the sample mean will be returned.

Larger gridsize results in more acurate estimates but also longer computation times. The use of gridsizes between \(2^{11}\) and \(2^{20}\) is recommended.

References

Jaki T., West R. W. (2008) Maximum kernel likelihood estimation. Journal of Computational and Graphical Statistics Vol. 17(No 4), 976-993.

See Also

klik

Examples

Run this code
data(state)
plot(density(state$CRIME))
abline(v=mean(state$CRIME),col='red')
abline(v=mkle(state$CRIME),col='blue')

Run the code above in your browser using DataLab