Learn R Programming

ks (version 1.5.10)

drvkde: 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, estimate.positive=FALSE)

Arguments

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).

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.

References

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

Examples

Run this code
## 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

Run the code above in your browser using DataLab