A list,
Ii. Source code
%----- least square method -- CLC; clear all; %% ------- data processing module ------------------ data(1,:)=xlsread('600085.xlsx'.'E5:E704'); %----------------- data normalization processing ---------- data(2,:)=xlsread('600085.xlsx'.'B5:B704'); % datamean=mean(data,2);
datastd=std(data,0.2);
Normdata=bsxfun(@minus,data,datamean)./repmat(datastd,1.700);
A1=Normdata(1, :); B1=Normdata(2, :); C=data(1, :); trainP=B1(1:600); % Training input data trainT=A1(1:600); % preInput=B1(601:700); % input data targetOutput=C(601:700); % % % target data -- -- -- -- -- least squares method -- -- -- -- -- -- -- -- -- -- -- -- -- -- A = trainP * trainT'*inv(trainT*trainT'); % preP=A*preInput;Copy the code
3. Operation results
Fourth, note
Version: 2014 a