## Query about implementing Linear Discriminant Analysis

Hi, I am trying to implement LDA on some fMRI data. Trying to do it myself rather that using a package as I'd like to understand whats going on under the bonnet as it were.

I have obtained a weight vector, $\displaystyle \mathbf{w}$, according to the formula

$\displaystyle \mathbf{w} \propto \mathbf{\Sigma}^{-1}_{w} (\mathbf{m}_{2} - \mathbf{m}_{1})$

where $\displaystyle \mathbf{\Sigma}^{-1}_{w}$ is the (inverse of the) total within-class covariance matrix and $\displaystyle \mathbf{m}$ denotes the mean of a class (class 2 and 1 in this case)

I can renormalise $\displaystyle \mathbf{w}$ to counter any numerical issues, since it is the direction and not the magnitude of this vector that is important. So far so good.

I should then be able to find a discriminant $\displaystyle c$, such that a new datum $\displaystyle \mathbf{x}$ is classified as belong to class 1 if $\displaystyle \mathbf{w} \cdot \mathbf{x} > c$ and class 2 otherwise.

I see intuitively that if the prior on each class is the same then (I think) $\displaystyle c = 1/2 \cdot (\mathbf{w} \cdot \mathbf{m}_{1} + \mathbf{w} \cdot \mathbf{m}_{2})$

Is that correct? But more importantly, is there a simple but principled way to establish $\displaystyle c$ in the case of asymmetric priors?

Many thanks in advance, MD