Matlab 偏最小二乘 PLSregress


  [XLOADINGS,YLOADINGS] = plsregress(X,Y,NCOMP)

  //  Ncomp:主成分個數

  // XLOADING : X 的線性組合系數矩陣

  //YLOADING : y 

  // XSCORES is an N-by-NCOMP orthonormal matrix with rows corresponding to observations, columns to components.

  // YSCORES is an N-by-NCOMP matrix with rows corresponding to observations,columns to components.   YSCORES is neither orthogonal nor normalized.

  //BETA is a (P+1)-by-M matrix, containing intercept terms(截距項) in the first row, i.e., Y = [ONES(N,1) X]*BETA + Yresiduals, and Y0 = X0*BETA(2:END,:) + Yresiduals.

  // PCTVAR containing the percentage of variance explained by the model.

  // MSE containing estimated mean squared errors for PLS models with 0:NCOMP components.

[XL2,YL2,XS2,YS2,BETA2,PCTVAR2,MSE2,stats2] =plsregress(a,b,ncomp)

 

beta3(1,:)=mu(n+1:end)-mu(1:n)./sig(1:n)*BETA2([2:end],:).*sig(n+1:end) %原始數據回歸方程的常數項

beta3([2:n+1],:)=(1./sig(1:n))'*sig(n+1:end).*BETA2([2:end],:) %計算原始變量x1,...,xn的系數,每一列是一個回歸方程

sig = std(data)

  -----------------------------------------------------------------------------------------------------

Χ1' = -4.1306 * u1+0.0558 *u2t

XL2 =

-4.1306 0.0558
-4.1933 1.0239
2.2264 3.4441


YL2 =

2.1191 -0.9714
2.5809 -0.8398
0.8869 -0.1877

XSCORES is an N-by-NCOMP orthonormal matrix with rows    corresponding to observations, columns to components.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM