[R] Kernel Density Estimation: Generate a sample from Epanechnikov Kernel

Justin Thong justinthong93 at gmail.com
Tue Mar 21 11:21:40 CET 2017


Below are samples from a kernel density estimated "data" with gaussian
kernel.
I really like this solution of estimation of a kernel because it is nice
and elegant.

fit<-density(data)
rnorm(N, sample(data, size = N, replace = TRUE), fit$bw)  #samples from
kernel density estimation

I am however interested in generating a kernel density estimate with
an Epanechnikov kernel

fit<-density(data,kernel = "epanechnikov")
#is there a quick way to compute the samples and INCORPORATING THE
BANDWIDTH of the #kernel density estimate


Yours sincerely,
Justin

*I check my email at 9AM and 4PM everyday*
*If you have an EMERGENCY, contact me at +447938674419(UK) or
+60125056192(Malaysia)*

	[[alternative HTML version deleted]]



More information about the R-help mailing list