声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1875|回复: 0

[人工智能] RBFNN一步预测混沌序列性能程序(转贴)

[复制链接]
发表于 2007-6-23 06:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
一个神经网络对logistic混沌序列一步预测的程序

  1. %% use logistic function to genenrate a sequence
  2. %%
  3. clear all;
  4. x=[];
  5. T=[];
  6. x(1)=0.22;
  7. k=4;
  8. n=900;
  9. N=400;
  10. % 产生logistic序列,前100个去除
  11. for i=1:n
  12.     x(i+1)=k*x(i)*(1-x(i));
  13. end
  14. X(1:800)=x(101:900);

  15. % 用X的前400个数据训练RBF神经网络
  16. for j=1:N   
  17.     P(1:8,j)=X(j:j+7)';
  18. end
  19. T=X(9:408);   % 目标数据
  20. net1=newrb(P,T,0.001,1);  % 训练RBF神经网络

  21. N1=300;

  22. % 选取X的400—700个数据进行RBF神经网络检验
  23. for j=1:N1
  24.     P1(1:8,j)=X(j+400:j+7+400)';
  25. end
  26. T1=X(409:708);   % 目标数据

  27. %仿真验证
  28. a=sim(net1,P1);  % 对检验数据的预测结果

  29. e = T1-a;        % 一步预测误差

  30. mse = sqrt(e*e')/size(e,2)    % 均方误差 Mean  Square  Error

  31. %画图描绘仿真结果
  32. figure(2)
  33. plot(X(1:200));
  34. axis([1 200 -0.1 1.1]);
  35. title('logistic混沌序列');
  36. xlabel('t');
  37. ylabel('magnitude');

  38. figure(3)
  39. plot(1:300,T1,'b',1:300,a,'r*');
  40. h = legend('混沌序列','RBF神经网络一步预测值');
  41. axis([1 300 -0.5 1.5]);
  42. hold on
  43. title('混沌序列与一步预测值');
  44. xlabel('t');
  45. ylabel('magnitude');


  46. figure(4);
  47. plot(e,'b-');
  48. axis([1 300 -0.1 0.1]);
  49. title('预测误差e');
  50. xlabel('t');
  51. ylabel('magnitude');
复制代码


转自:matwav--mary
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-21 00:43 , Processed in 0.063838 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表