INTERACTIVE ANIMATION : FISHER'S LINEAR DISCRIMINANT

This animation illustrates Fisher's linear discriminant.

 The "Book of Animations" on your computer

# Frame

The frame displays :

• Two classes, with their respective barycenters (crosses) and 1-standard deviation ellipses (see Covariance Matrix). Their Covariance Matrices are arbitrarily made very similar, a common hypothesis in Discriminant Analysis.
• A black straight line, which is their Fisher's linear discriminant. The class barycenters are projected on Fisher's discriminant.

Fisher's line may be dragged anywhere inside the frame for a more convenient reading. Remember only it's orientation matters, not its position.

The corresponding value of Fisher's criterion is displayed at the bottom right of the animation :

• Above this value is an orange bar, the top of which is currently stuck to the 100% horizontal segment.
• Fisher's criterion is the ratio of two positive terms, here denoted by "Num." and "Denom.".
• The Numerator is the square of the distance between the barycenters projections.
• The Denominator is the sum of the variances of the projected classes, ponderated by the respective class populations.

The values of these terms depend on the orientation of the candidate line, and the "100%" segment marks the largest values that each of them can take.

The scales are therfore different for the three bars.

Because we want the value of Fisher's criterion to be as large as possible, we would like to have simultaneously :

• The numerator at its maximum value,
• and the denominator at its lowest possible value.

But these two conditions are incompatible, and Fisher's criterion will take its largest value when both the numerator and the denominator are "somewhere in between " their respective extreme values.

# Animation

## Changing the orientation of the line

Click anywhere inside the frame and drag your mouse with the left button down. Fisher's discriminant starts pivoting and turns purple. In fact, it's not Fisher's discriminant anymore, just an arbitrary line.

Observe the bar display at the bottom right of the animation :

• The value of Fisher's criterion is always less than in it is the optimal orientation.
• It can go down to 0. Remember that the numerator is the square of the distance between the projected barycenters, so it is 0 when the line is orthogonal to the line joining the barycenters.
• Similarly, the numerator is at its maximum value when the line is parallel to the line joining the barycenters. But Fisher's criterion is then usually not at its maximum value because of the large spread of the projected classes (measured by the denominator).
• As you spin the line, observe the changes in the values of the numerator and denominator. These changes are "out of phase" by an amount which depends on the details of the geometry of the classes.

To restore the true Fisher's line, double-click anywhere inside the frame.

Changing the relative positions of the classes

You may drag classes, using their barycenters as "handles".

• If the line is Fisher's discriminant, it will adjust so as to remain so.
• Drag a class along the barycenters lines :
• Fisher's discriminant remains unchanged. This because it depends only on :
•  the direction of the barycenter line,
• and the class covariance matrices,

and none of these terms change during the drag.

• Fisher's criterion does change, though.
• It gets larger without limit as the classes are being pulled apart (better separation of projected classes).
• It gets to 0 when the distance between the barycenters tends to 0. Note that in this kind of situation, Fisher's discriminant becomes unstable : any direction of projection is just as bad as any other, and Fisher's discriminant is then poorly defined.

• Create a configuration ("New") where both classes have about the same principal direction. Drag a class so that its barycenter roughly stays on a circle around the other barycenter. Observe that Fisher's discriminant becomes parallel to the barycenter line when the ellispses' long axes are either parallel or perpendicular to the barycenter line.
• When the long axes are parallel to the barycenter line, the numerator and denominator are "in phase". Therefore, Fisher's criterion is stationnary, and at a low value (class projection separability is poor).
• When the short axes are parallel to the barycenter line, the numerator is at it's highest, the denominator is at its lowest, and Fisher's criterion has a large value (class projection separability is good).

• Drag a class on a path that will take its barycenter on top of the other barycenter. As the barycenters get closer :
• The value of Fisher's criterion tends to 0 (almost no separation at all).
• Fisher's discriminant becomes unstable : any direction of projection is just as bad as any other, and Fisher's discriminant is then poorly defined.

•  If the line is not Fisher's discriminant (purple), Fisher's criterion becomes arbitrary large as classes are dragged further apart : then any line will provide well separated class projections.