I have a PCA model in production. I take the 5 eigen vector which correspond to the 5 largest eigen values. Imaging the input data is 200 dimension, there will be a 5x200 matrix $V$ that project the raw data into eigen-space; after that, we project the low dimension 'feature' vector back to the 200 dimension raw space with $V^{T}$

Put together, the projection matrix is $V^{T}V$, which is 200x200 square

now here comes the question: if I need to generate such a matrix every day, how can I do sanity check on the projection matrix? Since the input samples are quite similar, this projection should not vary too much on daily basis. Therefore, I want to make sure that this matrix won't suddenly change a lot --- this is what I mean by 'sanity check'

I tried to plot a 'heatmap' out of the matrix, but it does not really tell much --- a 'top view' always shows the same thing.

What I am now using is the max min value of all the numbers in the matrix, but I feel it is not enough

Is there any other thing that I should be looking at? determinant ? trace?

any suggestions?

  • $\begingroup$ Could you explain more specifically what a "sanity check" is intended to reveal? $\endgroup$ – whuber Jan 19 '18 at 21:21
  • $\begingroup$ If you have a number of matrices that you know are correct, you could compute the Frobenius norms of all their differences and average them. You could then compare that to the average of the Frobenius norms of the new matrix to your vetted set. Just a thought. $\endgroup$ – meh Jan 19 '18 at 22:38
  • $\begingroup$ first why do you have 5 x 200 instead of 200 x 5? $\endgroup$ – Onyambu Nov 19 '20 at 2:35

Do you mean that you calculate new eigenvectors every day? Or you want to ensure that the same projection remains valid? The latter sounds safer to me.

The stability of an eigenvector calculation is revealed by the eigenvalues - if two consecutive eigenvectors have similar eigenvalues then the calculation is numerically unstable.

  • 1
    $\begingroup$ Consider the eigenvalues of an identity matrix... $\endgroup$ – jbowman Jan 20 '18 at 0:02
  • $\begingroup$ Yes, that's a good example. All vectors are eigenvectors of the identity matrix. No dimension reduction is possible. $\endgroup$ – chrishmorris Jan 22 '18 at 7:29
  • 1
    $\begingroup$ The point is that two consecutive eigenvectors have exactly the same eigenvalues, yet the calculation is certainly numerically stable. $\endgroup$ – jbowman Jan 22 '18 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.