View full-text article in PMC Sensors (Basel). 2018 Nov 10;18(11):3870. doi: 10.3390/s18113870 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1 NIPALS. 1: Set K. 2: X0=X−X¯. 3: y0=y−y¯. 4: fork=1 to K do 5: Derive the eigenvector wk which corresponds to the maximum eigenvalue of the following eigenvalue problem: Xk−1Tyk−1Tyk−1Xk−1wk=λwk. 6: tk=Xk−1wk. 7: pk=Xk−1Ttk/tkTtk. 8: bk=yk−1Ttk/tkTtk. 9: if k=K then 10: Output P=[p1,⋯,pK] and b=[b1,⋯bK]T. 11: end if 12: end for