⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 conpred1.m

📁 偏最小二乘算法在MATLAB中的实现
💻 M
字号:
function cm = conpred1(b,w,p,q,lv)
%CONPRED1 Converts PLS models to regression vectors
%  The inputs are the inner-relation coefficients (b),
%  the x-block weights (w), the x-block loadings (p), the
%  y-block loadings (q) and the number of latent variables
%  to consider (lv). The output is a the final regression
%  vector (cm) (or matrix if y is multivariate).
%  The I/O format is cm = conpred1(b,w,p,q,lv);
%
%  CONPRED1 works with either single or multiple variable y-block 
%  PLS models.

%  Copyright
%  Barry M. Wise
%  1991
%  Modified by B.M. Wise, November 1993

[rq,cq] = size(q);
m = conpred(b,w,p,q,lv);
if lv == 1
  cm = m';
else
  if rq == 1
    cm = (sum(m))';
  else
    cm = m(1:rq,:)';
    for i = 1:lv-1
      cm = cm + m(i*rq+1:(i+1)*rq,:)';
    end
  end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -