Standardize data matrix for PCA

Hi

I have just learnt about PCA and I am trying to make my first PCA code in Igor. From the preprocessing part in the Command Help of PCA:  

 This involves computing the average and standard deviation of each column and then setting the new values to be:
newValue=(oldValue-colAverage)/colStdv.
You can pre-process the input data using MatrixOp with the SubtractMean, NormalizeRows, and NormalizeCols functions.

I get the SubtractMean in MatrixOp, but I don't really understand how the NormalizeCols is similar to "/colStdv".  

normalizeCols(w)    Divides each column of the real wave w  by the square root of the sum of the squares of all elements of the column.

So it is sum of squares but not Stdv. But does that similarly standardize the data and yield the same result in PCA?

Thank you very much.

Chanan Euaruksakul

Maybe the documentation is not clear on this point, but if you use the /COV flag Igor computes the covariance matrix for you. 

If you want to compute it yourself you can use MatrixOP.  There are many ways to compute the equivalent in MatrixOP.  Subtracting the mean is the first step.  At this point you have columns of zero mean so the variance is basically the sum of the squares divided by (n-1) where n is the number of rows.  You can use MatrixOP varCols() function to get the variance directly.  Historically, varCols() was implemented about a year after NormalizeCols() and the PCA documentation was written for the initial version of MatrixOP.

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More