I have been trying to calculate the root mean squares error of calibration (RMSEC) and the root mean squares error of cross validation (RMSECV) for a PCA model made in R using the mdatools package.
My dataset is too complex to upload, however I followed the same method as shown in the link below:
Am I right in saying that both RMSEC and RMSECV are calculated as the square root of the residuals^2 divided by the number of samples? From the cross validated model, I am given values for Q distance. Are these the data that I use as the residuals when calculating the RMSEC and RMSECV? If so, I would have Q residuals for the calibration model, and Q residuals for the cross validated model.
Thanks in advance