Learn R Programming

ks (version 1.5.5)

kda.kde: Kernel density estimate for kernel discriminant analysis for multivariate data

Description

Kernel density estimate for kernel discriminant analysis for 1- to 6-dimensional data

Usage

kda.kde(x, x.group, Hs, hs, prior.prob=NULL, gridsize, supp=3.7,
        eval.points=NULL, binned=FALSE, bgridsize)

Arguments

x
matrix of training data values
x.group
vector of group labels for training data
Hs
(stacked) matrix of bandwidth matrices
hs
vector of scalar bandwidths
prior.prob
vector of prior probabilities
gridsize
vector of number of grid points
supp
effective support for standard normal is [-supp, supp]
eval.points
points at which density estimate is evaluated
binned
flag for binned kernel estimation
bgridsize
vector of binning grid sizes - only required if binned=TRUE

Value

  • The kernel density estimate for kernel discriminant analysis is based on kde, one density estimate for each group.

    The result from kda.kde is a density estimate for discriminant analysis is an object of class kda.kde which is a list with 6 fields

  • xdata points - same as input
  • x.groupgroup labels - same as input
  • eval.pointspoints that density estimate is evaluated at
  • estimatedensity estimate at eval.points
  • prior.probprior probabilities
  • Hbandwidth matrices (>1-d only) or
  • hbandwidths (1-d only)

Details

For d = 1, 2, 3, 4, and if eval.points is not specified, then the density estimate is computed over a grid defined by gridsize (if binned=FALSE) or by bgridsize (if binned=TRUE).

For d = 1, 2, 3, 4, and if eval.points is specified, then the density estimate is computed is computed exactly at eval.points. For d > 4, the kernel density estimate is computed exactly and eval.points must be specified.

If you have prior probabilities then set prior.prob to these. Otherwise prior.prob=NULL is the default i.e. use the sample proportions as estimates of the prior probabilities.

References

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

See Also

plot.kda.kde

Examples

Run this code
### See examples in ? plot.kda.kde

Run the code above in your browser using DataLab