Learn R Programming

ks (version 1.4.4)

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)

Arguments

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.probsample proportions of each group
  • Hbandwidth matrices (>1-d only) or
  • hbandwidths (1-d only)

Details

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.

For d > 1, the kernel density estimate is computed exactly i.e. binning is not used. For d = 1, the binned estimator from the KernSmooth library is used.

For d = 1, 2, 3, if eval.points is not specified, then the density estimate is automatically computed over a grid whose resolution is controlled by gridsize (default is 101, 51 x 51 and 51 x 51 x 51 respectively).

For d > 3, eval.points must be specified.

References

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

See Also

plot.kda.kde

Examples

Run this code
### bivariate example - restricted iris dataset  
library(MASS)
data(iris)
ir <- iris[,1:2]
ir.gr <- iris[,5]

H <- Hkda(ir, ir.gr, bw="plugin", pre="scale")
kda.fhat <- kda.kde(ir, ir.gr, H=H)

Run the code above in your browser using DataLab