# NOT RUN {
y <- rexp(100,1)
h <- 0.79 * IQR(y) * length(y) ^ (-1/5)
den <- Laplace(y, 200, h)
plot(den, type = "s", ylab = "Density Function", lty = 1, xlab = "Time")
d1 <- density(y, bw=h)
lines(d1,type="p",col="red")
legend("topright", c("Real Density", "Density by Laplace Kernel"), col=c("red", "black"))
# }
Run the code above in your browser using DataLab