Learn R Programming

klaR (version 1.7-3)

dkernel: Estimate density of a given kernel

Description

Given an estimated kernel density this function estimates the density of a new vector.

Usage

dkernel(x, kernel = density(x), interpolate = FALSE, ...)

Value

Denstiy of x in kernel.

Arguments

x

vector of which the density should be estimated

kernel

object of class density

interpolate

Interpolate or use density of nearest point?

...

currently not used.

Author

Karsten Luebke, karsten.luebke@fom.de

See Also

density, NaiveBayes

Examples

Run this code
kern <- density(rnorm(50))
x <- seq(-3, 3, len = 100)
y <- dkernel(x, kern)
plot(x, y, type = "l")

Run the code above in your browser using DataLab