Skip to main content
. 2023 Jul 16;23(14):6434. doi: 10.3390/s23146434
Algorithm 4 Typical principal component analysis
  • Input: EEG data D={x1,x2,...,xn}, low-dimensional space dimension d.

  • Output: Projection matrix W*=(w1,w2,...,wd).

  •  

  • procedure PCA(D):
    •      Sample centering xixi1mi=1mxi.
    •      Calculate XXT.
    •      Eigenvalue decomposition for XXT.
    •      Select the largest d eigenvalues.
    •      W*=(w1,w2,...,wd).
    •      New EEG data D*=W*TD.
    •      ReturnD*.