RBF预测模型

%RBF预测模型
%标准化后的测试数据集t_data
t_data=[0.1    0.68668    0.67143    0.79999    0.79091    0.40004;
0.36667    0.58001    0.1    0.7    0.71818    0.20001;
0.26    0.47334    0.1    0.29997    0.2091    0.80009;
0.36667    0.9    0.9    0.29997    0.13637    0.37504;
0.26    0.84668    0.67143    0.1    0.42727    0.37504;
0.36667    0.58001    0.44286    0.49999    0.1    0.55006;
0.15333    0.47334    0.44286    0.7    0.42727    0.60006;
0.1    0.84668    0.67143    0.29997    0.5    0.1;
0.15333    0.42    0.21429    0.49999    0.5    0.55006;
0.20667    0.79335    0.21429    0.59999    0.5    0.32503;
0.1    0.42    0.21429    0.9    0.5    0.45005;
0.1    0.84668    0.32857    0.59999    0.5    0.27502;
0.20667    0.47334    0.32857    0.29997    0.13637    0.50005;
0.1    0.68668    0.67143    0.49999    0.24546    0.20001;
0.42    0.58001    0.21429    0.9    0.9    0.42504;
0.31334    0.58001    0.44286    0.49999    0.31818    0.25002;
0.15333    0.42    0.1    0.19999    0.35454    0.55006;
0.20667    0.47334    0.32857    0.29997    0.31818    0.27502;
0.15333    0.68668    0.44286    0.29997    0.31818    0.40004;
0.20667    0.20667    0.21429    0.39999    0.28183    0.52506;
0.26    0.79335    0.21429    0.49999    0.57273    0.9;
0.42    0.36667    0.1    0.59999    0.35454    0.30003;
0.47334    0.36667    0.1    0.59999    0.57273    0.35003;
0.1    0.47334    0.67143    0.7    0.42727    0.49894;
0.42    0.58001    0.67143    0.49999    0.24546    0.47505;
0.31334    0.1    0.32857    0.9    0.79091    0.8501;
0.1    0.52667    0.21429    0.9    0.5    0.50005;
0.52667    0.55867    0.21429    0.1    0.28183    0.42504;
0.9    0.58001    0.55715    0.1    0.17273    0.32503;
0.15333    0.68668    0.62572    0.29997    0.2091    0.57506];
%初始化数据
tt=t_data(:,6);x=t_data(:,1:5);tt=tt';
%随机选取中心
c=x;
%定义delta平方为样本各点的协方差之和
delta=cov(x');
delta=sum(delta);
%隐含层输出R
for i=1:1:30
  for j=1:1:30
     R(i,j)=((x(i,:)-c(j,:)))*((x(i,:)-c(j,:))');
     R(i,j)=exp(-R(i,j)./delta(j));
  end
end
p=R;
%建模
%r=radbas(p);
err_goal=0.001;
sc=3;
net=newrb(p,tt,err_goal,sc,200,1);
%测试
ty=sim(net,p);
tE=tt-ty;
tSSE=sse(tE);
tMSE=mse(tE);
%预测(测试)曲线
figure;
 plot(tt,'-+');
 hold on;
 plot(ty,'r:*');
 legend('化验值','预测值');
 title('RBF网络模型输出预测曲线');
 xlabel('输入样本点');
 ylabel('淀粉利用率');
axis([1,30,0,1]);

猜你喜欢

转载自blog.csdn.net/ccsss22/article/details/114067862
rbf