# NOT RUN {
#Data can be simulated or real data
## Number of grid points "k" should be at least equal to the data size.
### If user define the generating scheme of gridpoints than number of gridpoints should
####be equal or greater than "k"
###### otherwise NA will be produced.
y <- rexp(100, 1)
xx <- seq(min(y) + 0.05, max(y), length = 100)
h <- 2
den <- Laplace(x = xx, y = y, k = 200, h = h)
##If scheme for generating gridpoints is unknown
y <- rexp(50, 1)
h <- 3
den <- Laplace(y = y, k = 90, h = h)
##If user do not mention the number of grid points
y <- rexp(23, 1)
xx <- seq(min(y) + 0.05, max(y), length = 90)
# }
# NOT RUN {
#any bandwidth can be used
require(KernSmooth)
h <- dpik(y)
den <- Laplace(x = xx, y = y, h = h)
# }
# NOT RUN {
#if bandwidth is missing
y <- rexp(100, 1)
xx <- seq(min(y) + 0.05, max(y), length = 100)
den <- Laplace(x = xx, y = y, k = 90)
# }
Run the code above in your browser using DataLab