When following the Matlab tutorial for "
Partial Least Squares Regression and Principal Components Regression", there is an error with the following line:
[PCALoadings,PCAScores,PCAVar] = pca(X,'Economy',false);
The error is as follows:
Undefined function 'pca' for
input arguments of type 'double'.
The pca() function is actually the same function as the princomp() function (
source), however this function doesn't take the same arguments as pca(). Hence removing all other arguments accept for "X" and replacing the function with princomp() appears to give the same results.
The new line that should replace it is as follows:
[PCALoadings,PCAScores,PCAVar] = princomp(X);
Continuing with the tutorial produces identical plots for the remainder of the tutorial.
No comments:
Post a Comment