您可以申请简单多元线性回归 http://www.stat.yale.edu/Courses/1997-98/101/linmult.htm for 复值数据.
步骤 1. 准备好用于线性回归的矩阵
您的线性系统
不用矩阵写成
重新排列产量
如果你用矩阵重写它,你会得到
步骤 2. 应用多元线性回归
设上面的系统为
where
现在您可以申请线性回归,返回最适合的α
when
where
is the 共轭转置.
在 MATLAB 中
Y = Z - A(:,1); % Calculate Y subtracting the first col of A from Z
R = A(:,:); R(:,1) = []; % Calculate R as an exact copy of A, just without first column
Rs = ctranspose(R); % Calculate R-star (conjugate transpose of R)
alpha = (Rs*R)^(-1)*Rs*Y; % Finally apply multiple linear regression
alpha = cat(1, 1, alpha); % Add alpha1 back, whose value is 1
或者,如果您愿意内置的, 看一下regress https://mathworks.com/help/stats/regress.html功能:
Y = Z - A(:,1); % Calculate Y subtracting the first col of A from Z
R = A(:,:); R(:,1) = []; % Calculate R as an exact copy of A, just without first column
alpha = regress(Y, R); % Finally apply multiple linear regression
alpha = cat(1, 1, alpha); % Add alpha1 back, whose value is 1