The Complete SPRLIB & ANNLIB

distance

- calculate the Mahalanobis distance given the coefficients (LOCAL)

SYNOPSIS

double distance (pattern, W2, W1, b, n)

ARGUMENTS

double *pattern The pattern of which the distance has to be determined, a vector of size [1..n].
double **W2 The quadratic component, a matrix of size [1..n][1..n].
double *W1 The linear component, a vector of size [1..n].
double b The constant term.
int n The dimension of the pattern pattern.

RETURNS

The function returns the Mahalanobis distance, as calculated according to the formula in the description of mahal_multiclass_dataset.

FUNCTION

Given the coefficients the Mahalanobis distance of a pattern to a certain class can be determined. By inputting W2, W1 and b and a pattern pattern the distance can be determined.

NOTE

The variables pattern and W1 are in vector format and W2 in matrix format.

SEE ALSO

mahal_multiclass_dataset, mahal_dataset

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