The Complete SPRLIB & ANNLIB

fisher

- compute the optimal linear discriminant function for two classes

SYNOPSIS

int fisher (Ka, Kb, Ma, Mb, c, n, W, b)

ARGUMENTS

double **Ka Covariance matrix for class A, a matrix of size [1..n][1..n].
double **Ka Covariance matrix for class B, a matrix of size [1..n][1..n].
double *Ma Mean vector for class A, a vector of size [1..n].
double *Mb Mean vector for class B, a vector of size [1..n].
double c The factor for apriori probabilities.
int n The dimensionality of the patterns.
double *W The linear term, a vector of size [1..n].
double b The constant component.

RETURNS

The function returns TRUE if an error occurred. If no error occurred the function returns FALSE and W and b contain valid values.

FUNCTION

This function computes the terms for the Fisher linear discriminant. The discrimimant is described by W*x + b. In order to calculate these parameters the covariances and means of both classes are needed. Furthermore the apriori probabilities are needed to compensate for inequalities. The parameter c is used for that since c equals P(b)/P(a) where P(a) and P(b) are the apriori probabilites for class A and B respectively.

NOTE

The matrices Ka ,Kb are in matrix format and the variables Ma, Mb, W and b are in vector format.

SEE ALSO

weight_vector

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998