Learn R Programming

ks (version 1.8.11)

plot.kda.kde: Plot for kernel discriminant analysis

Description

Plot for kernel discriminant analysis for 1- to 3-dimensional data.

Usage

## S3 method for class 'kda.kde':
plot(x, y, y.group, ...)

Arguments

x
object of class kda.kde (output from kda.kde)
y
matrix of test data points
y.group
vector of group labels for test data points
...
other graphics parameters

Value

  • Plot of 1-d and 2-d kernel density estimates are sent to graphics window. Plot for 3-d is sent to RGL window.

Details

For kda.kde objects, the function headers for the different dimensional data are ## univariate plot(x, y, y.group, prior.prob=NULL, xlim, ylim, xlab="x", ylab="Weighted density function", drawpoints=FALSE, col, ptcol, jitter=TRUE, rugsize, ...)

## bivariate plot(x, y, y.group, prior.prob=NULL, cont=c(25,50,75), abs.cont, approx.cont=FALSE, xlim, ylim, xlab, ylab, drawpoints=FALSE, drawlabels=TRUE, col, partcol, ptcol, ...)

## trivariate plot(x, y, y.group, prior.prob=NULL, cont=c(25,50,75), abs.cont, approx.cont=FALSE, colors, alphavec, xlab, ylab, zlab, drawpoints=FALSE, size=3, ptcol="blue", ...)

The arguments are [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] See plot.kde for more details.

See Also

kda.kde, kde

Examples

Run this code
library(MASS)
data(iris)

## univariate example
ir <- iris[,1]
ir.gr <- iris[,5]
hs <- hkda(x=ir, x.gr=ir.gr)
kda.fhat <- kda.kde(ir, ir.gr, hs=hs, xmin=3, xmax=9)
plot(kda.fhat, xlab="Sepal length")

## bivariate example
ir <- iris[,1:2]
ir.gr <- iris[,5]
H <- Hkda(ir, ir.gr, bw="plugin", pre="scale")
kda.fhat <- kda.kde(ir, ir.gr, Hs=H)
plot(kda.fhat)

Run the code above in your browser using DataLab