| kernelBiweight | R Documentation |
These functions, all with idenical argument lists, provide kernel functions for use with the KDE function.
kernelBiweight(x, mean = 0, sd = 1)
kernelCosine(x, mean = 0, sd = 1)
kernelEpanechnikov(x, mean = 0, sd = 1)
kernelGaussian(x, mean = 0, sd = 1)
kernelLogistic(x, mean = 0, sd = 1)
kernelOptCosine(x, mean = 0, sd = 1)
kernelRectangular(x, mean = 0, sd = 1)
kernelSquaredCosine(x, mean = 0, sd = 1)
kernelTriangular(x, mean = 0, sd = 1)
kernelTricube(x, mean = 0, sd = 1)
kernelTriweight(x, mean = 0, sd = 1)
kernelUniform(x, mean = 0, sd = 1)
x |
Values for which the kernel function is to be evaluated. |
mean |
Mean (or location parameter) of the kernel function. |
sd |
Standard deviation (or scale paramenter) of the kernel function. |
These are all continuous, symmetric probability density functions
parametrised by a location and scale parameter, here taken to be the
mean and standard deviation respectively. Most have finite support,
he two exceptions here being kernelGaussian and
kernelLogistic, which have unbounded support.
The functions provided cover all those listed in
https://en.wikipedia.org/wiki/Kernel_(statistics), with obvious
name correspondences. Of the additional ones, kernelSquaredCosine
appears to be thus far new, and kernelOptCosine is explained in
the help file for stats::density.
The functions kernelUniform and kernelRectangular are
identical, and provided for convenience.
The functions are vectorized with respect to all three parameters.
The evaluated kernel for each supplied x value.
Bill Venables
See this web site, primarily.
kde, density
if(require("graphics")) {
curve(kernelGaussian, xlim = c(-4.5, 4.5), ylim = c(0, 0.45))
curve(kernelLogistic, add = TRUE, col = "red")
curve(kernelUniform, add = TRUE, col = "blue", lwd=2, n = 5000)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.