Learn R Programming

fpc (version 2.1-6)

batcoord: Bhattacharyya discriminant projection

Description

Computes Bhattacharyya discriminant projection coordinates as described in Fukunaga (1990), p. 455 ff.

Usage

batcoord(xd, clvecd, clnum=1, dom="mean")
batvarcoord(xd, clvecd, clnum=1)

Arguments

xd
the data matrix; a numerical object which can be coerced to a matrix.
clvecd
integer or logical vector of class numbers; length must equal nrow(xd).
clnum
integer, one of the values of clvecd, if this is an integer vector. Bhattacharyya projections can only be computed if there are only two classes in the dataset. clnum is the number of one of the two classes. All the p
dom
string. dom="mean" means that the discriminant coordinate for the group means is computed as the first projection direction by discrcoord (option pool="equal"; both

Value

  • batcoord returns a list with the components ev, rev, units, proj. batvarcoord returns a list with the components ev, rev, units, proj, W, S1, S2.
  • evvector of eigenvalues. If dom="mean", then first eigenvalue from discrcoord. Further eigenvalues are of $S_1^{-1}S_2$, where $S_i$ is the covariance matrix of class i. For batvarcoord or if dom="variance", all eigenvalues come from $S_1^{-1}S_2$ and are ordered by rev.
  • revfor batcoord: vector of projected Bhattacharyya distances (Fukunaga (1990), p. 99). Determine quality of the projection coordinates. For batvarcoord: vector of amount of projected difference in variances.
  • unitscolumns are coordinates of projection basis vectors. New points x can be projected onto the projection basis vectors by x %*% units.
  • projprojections of xd onto units.
  • Wmatrix $S_1^{-1}S_2$.
  • S1covariance matrix of the first class.
  • S2covariance matrix of the second class.

Details

batvarcoord computes the optimal projection coordinates with respect to the difference in variances. batcoord combines the differences in mean and variance as explained for the argument dom.

References

Fukunaga, K. (1990). Introduction to Statistical Pattern Recognition (2nd ed.). Boston: Academic Press.

See Also

plotcluster for straight forward discriminant plots. discrcoord for discriminant coordinates.

rFace for generation of the example data used below.

Examples

Run this code
set.seed(4634)
face <- rFace(600,dMoNo=2,dNoEy=0)
grface <- as.integer(attr(face,"grouping"))
bcf2 <- batcoord(face,grface==2)
plot(bcf2$proj,col=1+(grface==2))
bcfv2 <- batcoord(face,grface==2,dom="variance")
plot(bcfv2$proj,col=1+(grface==2))
bcfvv2 <- batvarcoord(face,grface==2)
plot(bcfvv2$proj,col=1+(grface==2))

Run the code above in your browser using DataLab