2011년 10월 19일 수요일

Orthogonal Partial Least Squares Calibration

* Expression of matrix

 (MATRIX:[n x m]) ; n is the number of rows and m is the number of columns.

* Expression of column vector

 (MATRIX)(j,*) ;  j-th column vector of MATRIX

* Expression of row vector

 (MATRIX)(*,i) ; i-th row vector of MATRIX

* Operation for matrix

 (MATRIX)' ; transpose of Matrix
 (MATRIX)^(-1) ; inverse matrix

* Algorithm

Inputs

 n ; the number of samples
 m ; the number of dimension of independent value
 (X:[n x m]) ; independent values
 (y:[n x 1]) ; dependent values
 interation ; the number of iteration for calibration

Step 1.

Mean centering
(mx:[1 x m]) ; Mean of (X:[n x m])(*,i) for i = 0 ... n-1
(X_{0}:[n x m])(*,i) = (X:[n x m])(*,i) - (mx:[1 x m]) for i = 0 ... n-1

Step 2.

Loading Weight
(w_{a}:[m x 1]) = (X_{a-1}:[n x m])' * (y_{a-1}:[n x 1]) /
                         sqrt((y_{a-1}:[n x 1])' * (X_{a-1}:[n x m]) * (X_{a-1}:[n x m])' * (y_{a-1}:[n x 1]))

Step 3.

Scoring
(t_{a}:[n x 1]) = (X_{a-1}:[n x m]) * (w_{a}:[m x 1])

Step 4.
Spectral Loading
(p_{a}:[m x 1]) = (X_{a-1}:[n x m])' * (t_{a}:[n x 1]) / ((t_{a}:[n x 1])' * (t_{a}:[n x 1]))

Step 5.

Chemical Loading
(q_{a}:[1 x 1]) = (y_{a-1}:[n x 1])' * (t_{a}:[n x 1]) / ((t_{a}:[n x 1])' * (t_{a}:[n x 1]))

Step 6.

Updating
(X_{a}:[n x m]) = (X_{a-1}:[n x m]) - (t_{a}:[n x 1]) * (p_{a}:[m x 1])'
(y_{a}:[n x 1]) = (y_{a-1}:[n x 1]) - (t_{a}:[n x 1]) * (q_{a}:[1 x 1])
a = a + 1

Step 7.

Until 'a' is equal to "iteration" repeat Step 2, 3, 4, 5, and 6.

Step 8.

(b:[m x 1]) = (W:[m x iteration]) * ((P:[m x iteration])' * (W:[m x iteration]))^(-1) * (Q:[iteration x 1])
(b0:[1 x 1]) = (my:[1 x 1]) - (mx:[1 x m]) * (b:[m x 1])

where

(W:[m x iteration])(a,*) = (w_{a}:[m x 1])
(P:[m x iteration])(a, *) = (p_{a}:[m x 1])
(Q:[iteration x 1])(a, *) = (q_{a}:[1 x 1])
(my:[1 x 1]) ; Mean of (y:[m x 1])(0,i) for i = 0 ... n-1

* Prediction

(y^:[1 x 1]) = (b0:[1 x 1]) + (x:[1 x m]) * (b:[m x 1])

댓글 없음:

댓글 쓰기