Kdensity {MKLE} | R Documentation |
Evaluates the shifted kernel density estimator
Kdensity(x, data, Kernel = dnorm, bw = 2*sd(data), theta = mean(data))
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. |
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).
The value of the kernel density estimator
Thomas Jaki
Silverman, B. W. (1986) Density Estimation for Statistics and Data Analysis. Chapman & Hall
## 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)