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

matlab的一些常用算法VIP免费

matlab的一些常用算法_第1页
1/16
matlab的一些常用算法_第2页
2/16
matlab的一些常用算法_第3页
3/16
一 基于均值生成函数时间序列预测算法程序 1. predict_fun.m 为主程序; 2. timeseries.m 和 seriesexpan.m 为调用的子程序 function ima_pre=predict_fun(b,step) % main program inv okes timeseries.m and seriesex pan.m % inpu t parameters: % b-------the training data (v ector); % step----nu mber of prediction data; % ou tpu t parameters: % ima_pre---the prediction data(v ector); old_b=b; mean_b=su m(old_b)/length(old_b); std_b=std(old_b); old_b=(old_b-mean_b)/std_b; [f,x ]=timeseries(old_b); old_f2=seriesex pan(old_b,step); % f(f<0.0001&f>-0.0001)=f(f<0.0001&f>-0.0001)+eps; R=corrcoef(f); [eigv ector eigroot]=eig(R); eigroot=diag(eigroot); a=eigroot(end:-1:1); v ector=eigv ector(:,end:-1:1); Dev ote=a./su m(a); Dev otem=cu msu m(Dev ote); m=find(Dev otem>=0.995); m=m(1); V1=f*eigv ector'; V=V1(:,1:m); % old_b=old_b; old_fai=inv (V'*V)*V'*old_b; eigv ector=eigv ector(1:m,1:m); fai=eigv ector*old_fai; f2=old_f2(:,1:m); predictv alu e=f2*fai; ima_pre=std_b*predictv alu e+mean_b; 1.子函数: timeseries.m % timeseries program% % this program is u sed to generate mean v alu e matrix f; function [f,x]=timeseries(data) % data--------the inpu t sequ ence (v ector); % f------mean value matrix f; n=length(data); for L=1:n/2 nL=floor(n/L); for i=1:L sum=0; for j=1:nL sum=sum+data(i+(j-1)*L); end x{L,i}=sum/nL; end end L=n/2; f=zeros(n,L); for i=1:L rep=floor(n/i); res=mod(n,i); b=[x{i,1:i}];b=b'; f(1:rep*i,i)=repmat(b,rep,1); if res~=0 c=rep*i+1:n; f(rep*i+1:end,i)=b(1:length(c)); end end % seriesexpan.m % the program is used to generate the prediction matrix f; function f=seriesexpan(data,step); %data---- the input sequence (vector) % setp---- the prediction number; n=length(data); for L=1:n/2 nL=floor(n/L); for i=1:L sum=0; for j=1:nL sum=sum+data(i+(j-1)*L); end x{L,i}=sum/nL; end end L=n/2...

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

碎片内容

matlab的一些常用算法

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