lda function

Linear Discrimination

Linear Discrimination

Finds the coefficients aka_k and constants ckc_k for Fisher's linear discrimination function dkd_k in (11.31) and (11.32).

lda(x, y)

Arguments

  • x: The NxPN x P data matrix.
  • y: The NN-vector of group identities, assumed to be given by the numbers 1,...,KK for KK groups.

Returns

A list with the following components:

  • a: A PxKP x K matrix, where column KK contains the coefficents aka_k for (11.31). The final column is all zero.
  • c: The KK-vector of constants ckc_k for (11.31). The final value is zero.

Examples

# Iris example x.iris <- as.matrix(iris[, 1:4]) # Gets group vector (1, ... , 1, 2, ... , 2, 3, ..., 3) y.iris <- rep(1:3, c(50, 50, 50)) ld.iris <- lda(x.iris, y.iris)

See Also

sweep

  • Maintainer: James Balamuta
  • License: MIT + file LICENSE
  • Last published: 2020-10-31

Downloads (last 30 days):