# Multiple Factor Analysis Based on NIPALS Algorithm to Solve Missing Data Problems
## 2 Methods
### Nonlinear Iterative Partial Least Squares  
NIPALS is a key algorithm for PLS regression [24; 33; 34] and mainly does a singular decomposition of a data matrix through convergent iterative sequences of orthogonal projections, which is a basic geometric concept of simple regression. NIPALS results are equivalent to PCA ones. Let \(\mathbf{X}\) be an \(n\times p\) data matrix with rank \(q\leq p\) and columns \(X_{1},X_{2},\ldots,X_{p}\) assumed as centered or standardized using sample variance. The reconstitution derived from PCA uses:  
\[\mathbf{X}=\sum_{h=1}^{q}\mathbf{t}_{h}\mathbf{p}_{h}^{\top}, \tag{12}\]  
where \(\mathbf{t}_{h}\) is the principal component (or score) and \(\mathbf{p}_{h}^{\top}\) is the eigenvector (loadings) on axis \(h\)[18]. The pseudo-codes are presented in Algorithms 2 and 3 for NIPALS with complete data and with NAs, respectively. ```
0:\(X_{0}=X_{h}\) while\(h\leq q\)do\(h=1,2,\ldots,q\). \(\mathbf{t}_{h}\) as the first column \(X_{h-1}\). Repeat until the convergence of \(\mathbf{p}_{h}\). Compute: \[\mathbf{p}_{h}=\frac{X_{h-1}^{\top}\mathbf{t}_{h}}{\mathbf{t}_{h}^{\top}\mathbf{t}_{h}}.\] (13)  Normalize \(\mathbf{p}_{h}\) to \(1\). Compute: \[\mathbf{t}_{h}=\frac{X_{h-1}\mathbf{p}_{h}}{\mathbf{p}_{h}^{\top}\mathbf{p}_{h}}.\] (14)  Compute \(X_{h}=X_{h-1}-\mathbf{t}_{h}\mathbf{p}_{h}^{\top}\) (to ensure orthogonality). Increment: \(h=h+1\). endwhile
```  
**Algorithm 2** NIPALS with complete data  
```
0:\(X_{0}=X_{h}\) while\(h\leq q\)do\(h=1,2,\ldots,q\). \(\mathbf{t}_{h}\) as the first column \(X_{h-1}\). Repeat until the convergence of \(\mathbf{p}_{h}\). while\(j\leq p\)do\(j=1,2,\ldots,p\). Compute: \[p_{hj}=\frac{\langle X_{h-1},\mathbf{t}_{h}\rangle}{\langle\mathbf{t}_{h},\mathbf{t}_{h} \rangle}.\]  Normalize \(\mathbf{p}_{h}\) to \(1\). For \(i=1,2,\ldots,n\), compute: \[t_{hi}=\frac{\langle X_{h-1},\mathbf{p}_{h}\rangle}{\langle\mathbf{p}_{h},\mathbf{p}_{h} \rangle}.\]  Increment: \(j=j+1\). endwhile  Compute \(X_{h}=X_{h-1}-\mathbf{t}_{h}\mathbf{p}_{h}^{\top}\) (to ensures orthogonality). Increment: \(h=h+1\). endwhile
```  
**Algorithm 3** NIPALS with NAs  
### Nonlinear Iterative Partial Least Squares  
NIPALS is a key algorithm for PLS regression [24; 33; 34] and mainly does a singular decomposition of a data matrix through convergent iterative sequences of orthogonal projections, which is a basic geometric concept of simple regression. NIPALS results are equivalent to PCA ones. Let \(\mathbf{X}\) be an \(n\times p\) data matrix with rank \(q\leq p\) and columns \(X_{1},X_{2},\ldots,X_{p}\) assumed as centered or standardized using sample variance. The reconstitution derived from PCA uses:  
\[\mathbf{X}=\sum_{h=1}^{q}\mathbf{t}_{h}\mathbf{p}_{h}^{\top}, \tag{15}\]  
where \(\mathbf{t}_{h}\) is the principal component (or score) and \(\mathbf{p}_{h}^{\top}\) is the eigenvector (loadings) on axis \(h\)[18]. The pseudo-codes are presented in Algorithms 2 and 3 for NIPALS with complete data and with NAs, respectively. ```
0:\(X_{0}=X_{h}\) while\(h\leq q\)do\(h=1,2,\ldots,q\). \(\mathbf{t}_{h}\) as the first column \(X_{h-1}\). Update \(\mathbf{p}_{h}\) to \(1\). Compute: \[\mathbf{t}_{h}=\frac{X_{h-1}\mathbf{p}_{h}}{\mathbf{p}_{h}^{\top}\mathbf{p}_{h}}.\]  Compute \(X_{h}=X_{h-1}-\mathbf{t}_{h}\mathbf{p}_{h}^{\top}\) (to ensure orthogonality). Increment: \(h=h+1\). endwhile
```  
**Algorithm 4** NIPALS with complete data  
```
0:\(X_{0}=X_{h}\) while\(h\leq q\)do\(h=1,2,\ldots,q\). \(\mathbf{t}_{h}\) as the first column \(X_{h-1}\). Repeat until the convergence of \(\mathbf{p}_{h}\). while\(j\leq p\)do\(j=1,2,\ldots,p\). Compute: \[p_{hj}=\frac{\langle X_{h-1},\mathbf{t}_{h}\rangle}{\langle\mathbf{t}_{h},\mathbf{t}_{h} \rangle}.\]  Normalize \(\mathbf{p}_{h}\) to

### Available Data Principle

This principle is related to some operations between vectors that can be performed by avoiding non-available data and works with available paired points [19; 25], i.e., if we have two vectors, \(\mathbf{X}\) and \(\mathbf{Y}\) (both with presence of NAs):

\[\mathbf{X}=