建模.m
上传用户:yetwld
上传日期:2010-01-26
资源大小:82k
文件大小:1k
- %主元分析后的数据集124*6——6×6
- %建模数据
- m_data=[0.17291 0.61562 -0.23182 0.72739 -0.085257 -0.031892;
- -0.51861 -0.16758 -0.19343 0.11447 -0.80028 0.10954;
- -0.21276 -0.65128 -0.070456 0.61803 0.36643 -0.096825;
- 0.5657 -0.29331 -0.19992 0.06454 -0.14817 0.72654;
- 0.56077 -0.28381 -0.17084 -0.01873 -0.35697 -0.66935;
- 0.14631 -0.046753 0.91363 0.26708 -0.26198 0.041455];
- %RBF建模
- % K-means法确定RBF函数的中心、宽度和输出权值
- x=m_data(:,1:5);y=m_data(:,6);
- c=x;
- for i=1:1:6
- for j=1:1:6
- h(i,j)=(x(i,:)-c(j,:))*((x(i,:)-c(j,:))');
- end
- end
- for j=1:1:6
- cc(j)=min(h(j));
- end
- fai=exp(-(x-c)*((x-c)')/(2*delta));??
- (??for i=1:1:6
- for j=1:1:6
- fai=exp(-(x(i,:)-c(j,:))*((x(i,:)-c(j,:))')/(2*delta)); [fai]=1*1??
- end
- end??
- [ww,bint,err,errint,states]=regress(y,fai);
- yy=purelin(fai*ww);
- x=m_data(:,1:5);y=m_data(:,6);
- p=x';
- t=y';net=newrbe(p,t);
- yy=sim(net,p);figure;plot(t,'r');hold on;plot(yy,'*');