Skip to main content
. 2018 Nov 10;18(11):3870. doi: 10.3390/s18113870
Algorithm 1 NIPALS.
  • 1: 

    Set K.

  • 2: 

    X0=XX¯.

  • 3: 

    y0=yy¯.

  • 4: 

    fork=1 to K do

  • 5: 

     Derive the eigenvector wk which corresponds to the maximum eigenvalue of the following eigenvalue problem: Xk1Tyk1Tyk1Xk1wk=λwk.

  • 6: 

    tk=Xk1wk.

  • 7: 

    pk=Xk1Ttk/tkTtk.

  • 8: 

    bk=yk1Ttk/tkTtk.

  • 9: 

    if k=K then

  • 10: 

      Output P=[p1,,pK] and b=[b1,bK]T.

  • 11: 

    end if

  • 12: 

    end for