drvkde {ks}R Documentation

Kernel density derivative estimation

Description

Compute kernel density derivative estimates and standard errors for multivariate data.

Usage

drvkde(x, drv, bandwidth, gridsize, range.x, binned=FALSE, se=TRUE)

Arguments

x data matrix or matrix of binning counts
drv vector of derivative indices
bandwidth vector of bandwidths
gridsize vector of grid sizes
range.x list of vector of ranges for x
binned TRUE if x is binned counts or FALSE if x is data matrix
se flag for computing the standard error of kernel estimate

Details

The estimates and standard errors are computed over a grid of binned counts x.grid. If the binned counts are not supplied then they are computed inside this function.

If gridsize and range.x are not supplied, they are computed inside this function.

Value

Returns a list with fields
x.grid - grid points
est - kernel estimate of partial derivative of density function indicated by drv
se - estimate of standard error of est (if se=TRUE).

Author(s)

M.P. Wand

References

Wand, M.P. and Jones, M.C. (1995) Kernel Smoothing. Chapman & Hall/CRC, London.

Examples

## univariate
x <- rnorm(100)
fhat <- drvkde(x=x, drv=0, bandwidth=0.1)    ## KDE of f
fhat1 <- drvkde(x=x, drv=1, bandwidth=0.1)   ## KDE of df/dx

[Package ks version 1.6.2 Index]