n = number of observations
A = number of principal components
T2 Statistic
where PA is a matrix containing the first A eigenvectors and L is a diagonal matrix containing the first A eigenvalues.