I wanted to demonstrate a small example in order to understand better the $\textbf{Nonlinear Iterative Partial Least}$ $\textbf{Squares algorithm}$.
My goal is to calculate all the Principal components of a $3\times 3$ matrix iteratively.
So, I defined the following matrix $X$
X
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 2 2
[3,] 0 0 1
I centered the matrix $X$ and followed the exact same steps described on the section $\textbf{NIPALS}$ in this $R$ pdf, https://cran.r-project.org/web/packages/nipals/vignettes/nipals_algorithm.html.
The algorithm that I wrote found correctly the first two principal components, $PC_{1},PC_{2}$ (with different signs than the ones calculated from the $PCA$ method) but it calculated completely wrong the last principal component $PC_{3}$. Is this something expected, because I read that $\textbf{NIPALS}$ is a method for calculating a few principal components, so I assume because it is an approximation method it might not me able to calculate all the principal components.