Learn R Programming

rlcv (version 1.0.0)

kde: Univariate kernel density

Description

Univariate kernel density

Usage

kde(x.obs, x.new = NULL, h)

Arguments

x.obs

Training (observed) data (n1 vector)

x.new

Evaluation data (n2 vector); default to x.obs

h

Bandwidth

Value

Density evaluated at x.new

References

Wu, Ximing (2019), "Robust Likelihood Cross Validation for Kernel Density Estimation," Journal of Business and Economic Statistics, 37(4): 761-770.

Examples

Run this code
# NOT RUN {
x=rnorm(100)
x.new=seq(-5,5,length=50)
h=1.06*sd(x)*(length(x))^(-1/5)
f=kde(x.new=x.new,x.obs=x,h=h)
# }

Run the code above in your browser using DataLab