电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

偏最小二乘法PLS回归NIPALS算法的Matlab程序及例子②VIP免费

偏最小二乘法PLS回归NIPALS算法的Matlab程序及例子②_第1页
1/9
偏最小二乘法PLS回归NIPALS算法的Matlab程序及例子②_第2页
2/9
偏最小二乘法PLS回归NIPALS算法的Matlab程序及例子②_第3页
3/9
偏最小二乘法PLS回归NIPALS算法的Matlab程序及例子②function[T,P,W,Wstar,U,b,C,B_pls,...Bpls_star,Xori_rec,Yori_rec,...R2_X,R2_Y]=PLS_nipals(X,Y,nfactor)%USAGE:[T,P,W,Wstar,U,b,C,Bpls,Bpls_star,Xhat,Yhat,R2X,R2Y]=PLS_nipals(X,Y,nfact)%PLSregressionNIPALSalgorithmPLS回归NIPALS算法%ComputethePLSregressioncoefficientsPLS回归系数的计算%X=T*P'Y=T*B*C'=X*BplsXandYbeingZ-scores%B=diag(b)%Y=X*Bpls_starwithXbeingaugmentedwithacolofones%andYandXhavingtheiroriginalunits%T'*T=I(NBnormalization<>SAS)%W'*W=I%%TestforPLSregression%HerveAbdiNovember2002/revNovember2004%%%VersionwithT,W,andCbeingunitnormalized%U,Parenot%nfact=numberoflatentvariablestokeep保持潜在变量的数量%default=rank(X)X_ori=X;Y_ori=Y;ifexist('nfactor')~=1;nfactor=rank(X);endM_X=mean(X);M_Y=mean(Y);S_X=std(X);S_Y=std(Y);X=zscore(X);Y=zscore(Y);[nn,np]=size(X);[n,nq]=size(Y);ifnn~=n;error(['Incompatible#ofrowsforXandY']);end%Precisionforconvergenceepsilon=eps;%#ofcomponentskepts%Initialistion%TheYsetU=zeros(n,nfactor);C=zeros(nq,nfactor);%TheXsetT=zeros(n,nfactor);P=zeros(np,nfactor);W=zeros(np,nfactor);b=zeros(1,nfactor);R2_X=zeros(1,nfactor);R2_Y=zeros(1,nfactor);Xres=X;Yres=Y;SS_X=sum(sum(X.^2));SS_Y=sum(sum(Y.^2));forl=1:nfactort=normaliz(Yres(:,1));t0=normaliz(rand(n,1)*10);u=t;nstep=0;maxstep=100;while(((t0-t)'*(t0-t)>epsilon/2)&(nstepTh...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

偏最小二乘法PLS回归NIPALS算法的Matlab程序及例子②

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部