Compute orthogonal Euclidean distance from object to PC space (Q, q) and Mahalanobis squared distance between projection of the object to the space and its origin (T2, h).
ldecomp.getDistances(scores, loadings, residuals, eigenvals)matrix with scores (T).
matrix with loadings (P).
matrix with residuals (E).
vector with eigenvalues for the components
Returns a list with Q, T2 and tnorm values for each component.
The distances are calculated for every 1:n components, where n goes from 1 to ncomp (number of columns in scores and loadings).