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.

转载于:https://www.cnblogs.com/zero27315/p/10651109.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值