4
$\begingroup$

I'm doing a project in MATLAB where I need to do dimensionality reduction and reconstruction using PCA. This is going fine however I noticed that when trying to reconstruct an image using all eigenvectors the reconstruction error (I use RMSE) is not equal to zero. Which I think it should be if I understand PCA correctly. Visually I don't see any difference between the original and the reconstruction of the image, but the RMSE between the two has a value of 4.5538e-16.

So my question now is why is this not zero? Has this to do with some rounding errors in MATLAB or am I doing something wrong or misunderstanding something?

$\endgroup$

1 Answer 1

6
$\begingroup$

It's rounding errors.

Floating point arithmetic (IEEE 754) is not exact. In double-precision, errors on the order of $10^{-16}$ are effectively zero.

Some related discussion, in the context of p-values reported in R, can be found in How should tiny $p$-values be reported? (and why does R put a minimum on 2.22e-16?)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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