Kdensity {MKLE}R Documentation

Kernel density estimator

Description

Evaluates the shifted kernel density estimator

Usage

Kdensity(x, data, Kernel = dnorm, bw = 2*sd(data), theta = mean(data))

Arguments

x point at which the kernel density estimator is evaluated.
data the data from which the estimate is to be computed.
Kernel a R function to be used as the kernel function.
bw the smoothing bandwidth to be used.
theta the location parameter used.

Details

The location parameter theta shifts the kernel density estimator. Instead of centering the individual kernels on top of each datapoint, they will be shifted by theta-mean(data). Setting theta=mean(data) therefore gives the usual kernel density estimator.

1/(nh)sum K((y-X_i-bar X+theta)/h).

Value

The value of the kernel density estimator

Author(s)

Thomas Jaki

References

Silverman, B. W. (1986) Density Estimation for Statistics and Data Analysis. Chapman & Hall

See Also

density

Examples


## plots the kernel density estimator
data(state)
attach(state)
x<-seq(min(crime)-10,max(crime)+10,0.1)
plot(x,Kdensity(x,crime,theta=mean(crime)),type='l',ylab='Kernel Density',xlab='',lwd=2)


[Package MKLE version 0.02 Index]