我用matlab编写的RBFN神经网络预测模型,供大家参考
%rbfn predict
close all
clear all
load tempz5000;
p=x(1:100,1:6);p=p';
t=x(1:100,8);t=t';
net=newgrnn(p,t,0.065);%0.065 is the spread parameter with ess=4.86,it should be check,standard data 0.1 the best with an ess=5
y=sim(net,p);
ess=t-y;
res=(norm(ess)).^2
%---check
m=x(101:200,1:6);m=m';
n2=x(101:200,8);n2=n2';
n=sim(net,m);
ess2=n-n2;
figure(1);
plot(ess2,'r-o')
res2=norm(ess2).^2
figure(3)
i=10:90;
plot(i,n2(i),'k-+',i,n(i),'b-*')
title('predict :black is true,blue is mrls ')
注意,其中的tempz5000文件是6输入1输出,此处略