NIPALS Algorithm

The standard algorithm for computing partial least squares regression components (i.e., factors) is nonlinear iterative partial least squares (NIPALS). There are many variants of the NIPALS algorithm that normalize or do not normalize certain vectors. The following algorithm, which assumes that the X and Y variables have been transformed to have means of zero, is considered to be one of most efficient NIPALS algorithms.

For each h=1,…,c, where A0=X’Y, M0=X’X, C0=I, and c given,

1. compute qh, the dominant eigenvector of Ah’Ah

2. wh=ChAhqh, wh=wh/||wh||, and store wh into W as a column

3. ph=Mhwh, ch=wh’Mhwh, ph=ph/ch, and store ph into P as a column

4. qh=Ah’wh/ch, and store qh into Q as a column

5. Ah+1=Ah – chphqh’ and Mh+1=Mh – chphph

6. Ch+1=Ch – whph

The factor scores matrix T is then computed as T=XW and the partial least squares regression coefficients B of Y on X are computed as B=WQ.