IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
calculate_scatters.m File Reference

Detailed Description

Calculates scatter matrices from X and classes.

Definition in file calculate_scatters.m.

Go to the source code of this file.

Functions

function calculate_scatters (in X, in classes, in flag_modified_s_b, in P)
 

Function Documentation

function calculate_scatters ( in  X,
in  classes,
in  flag_modified_s_b,
in  P 
)
Parameters
X[no]x[nf] matrix
classes[no]x[1] matrix
flag_modified_s_bif 1, S_B will be calculated in an alternative way which is class terms will not be weighet by class sample size, which will cause all classes to have equal importance.
Ppenalty matrix to be added to S_W
Returns
[S_B, S_W] Respectively "inter-class scatter matrix" and "within-class scatter matrix"