# Linear Discriminant Function

In linear discriminant analysis, how is the linear discriminant function determined? Assuming equal variance-covariance matrices, is the linear discriminant function determined from the training data?

• The formula given by @Mimshot is only for 2-class situation. See complete set of formulas to get the discriminants for k-class situation here – ttnphns Oct 28 '13 at 17:23

For Linear discriminant analysis the linear discriminant function is just the inner product of a given data point $\vec{x}$ with the vector $\vec{w}$, with the criterion $\vec{x} \cdot \vec{w} > c$. The vector $\vec{w}$ is calculated as:
$$\vec{w} = \Sigma^{-1}(\vec{\mu_0} - \vec{\mu_1})$$
Where $\vec{\mu_n}$ is the vector mean of sample class $n$, that is, the mean of the training data for class $n$.