kernel.fun {kedd}R Documentation

Derivatives of Kernel Function

Description

The (S3) generic function kernel.fun computes the r'th derivative for kernel density.

Usage

kernel.fun(x, ...)
## Default S3 method:
kernel.fun(x = NULL, deriv.order = 0, kernel = c("gaussian","epanechnikov", 
            "uniform", "triangular", "triweight", "tricube", 
            "biweight", "cosine", "silverman"), ...)

Arguments

x

points at which the derivative of kernel function is to be evaluated.

deriv.order

derivative order (scalar).

kernel

a character string giving the smoothing kernel to be used, with default "gaussian".

...

further arguments for (non-default) methods.

Details

We give a short survey of some kernels functions K(x;r); where r is derivative order,

The r'th derivative for kernel function K(x) is written:

K^{(r)}(x) = \frac{d^{r}}{d x^{r}} K(x)

for r = 0, 1, 2, \dots
The r'th derivative of the Gaussian kernel K(x) is given by:

K^{(r)}(x) = (-1)^{r} H_{r}(x) K(x)

where H_{r}(x) is the r'th Hermite polynomial. This polynomials are set of orthogonal polynomials, for more details see, hermite.h.polynomials in package orthopolynom.

Value

kernel

name of kernel to use.

deriv.order

the derivative order to use.

x

the n coordinates of the points where the derivative of kernel function is evaluated.

kx

the kernel derivative values.

Author(s)

Arsalane Chouaib Guidoum acguidoum@usthb.dz

References

Jones, M. C. (1992). Differences and derivatives in kernel estimation. Metrika, 39, 335–340.

Olver, F. W., Lozier, D. W., Boisvert, R. F. and Clark, C. W. (2010). NIST Handbook of Mathematical Functions. Cambridge University Press, New York, USA.

Silverman, B. W. (1986). Density Estimation for Statistics and Data Analysis. Chapman & Hall/CRC. London.

See Also

plot.kernel.fun, deriv and D in package "stats" for symbolic and algorithmic derivatives of simple expressions.

Examples

kernels <- eval(formals(kernel.fun.default)$kernel)
kernels

## gaussian
kernel.fun(x = 0,kernel=kernels[1],deriv.order=0)
kernel.fun(x = 0,kernel=kernels[1],deriv.order=1)

## silverman
kernel.fun(x = 0,kernel=kernels[9],deriv.order=0)
kernel.fun(x = 0,kernel=kernels[9],deriv.order=1)

[Package kedd version 1.0.4 Index]