【RBF预测】基于RBF神经网络实现数据预测含Matlab源码

本文介绍了利用RBF神经网络进行数据预测,并对比了标准RBF网络与改进的ST-RBF网络在训练和测试阶段的表现。通过绘制输入输出信号图和均方误差(MSE)曲线,展示了两种模型在预测能力和准确性上的差异。实验结果表明ST-RBF网络在预测任务上可能具有更好的性能。

1 简介

数据预测是指在分析现有数据的基础上估计或推测未来的数据的过程.神经网络具有良好的训练性和自学习能力,能够对大量复杂数据进行分析,特别是RBF网络模型,非常适合解决预测问题.随着云计算技术的迅速发展,数据获取,数据存储,数据分析的能力的发展和普及,使得在传统模式下很难进行的大数据量数据预测成为可能.

2 部分代码

clcclear allclose allST_RBF = load('ST_RBF.mat');RBF = load('RBF.mat');%%  Results% Input and output signals (training phase)figureplot(ST_RBF.indt,ST_RBF.f_train,'k','linewidth',ST_RBF.lw);hold on;% plot(RBF.indt,RBF.f_train,'r','linewidth',RBF.lw);plot(RBF.indt,RBF.y_train,'.:b','linewidth',RBF.lw);plot(ST_RBF.indt,ST_RBF.y_train,'--r','linewidth',ST_RBF.lw);xlim([ST_RBF.start_of_series_tr+ST_RBF.time_steps ST_RBF.end_of_series_tr]);h=legend('Actual Value (Training)','RBF Predicted (Training)','ST-RBF Predicted (Training)','Location','Best');grid minorxlabel('Sample #','FontSize',ST_RBF.fsize);ylabel('Magnitude','FontSize',ST_RBF.fsize);set(h,'FontSize',12)set(gca,'FontSize',13)saveas(gcf,strcat('Time_SeriesTraining.png'),'png')% Input and output signals (test phase)figureplot(ST_RBF.indts,ST_RBF.f_test,'k','linewidth',ST_RBF.lw);hold on;plot(RBF.indts,RBF.y_test,'.:b','linewidth',RBF.lw);plot(ST_RBF.indts,ST_RBF.y_test,'--r','linewidth',ST_RBF.lw);xlim([ST_RBF.start_of_series_ts+ST_RBF.time_steps ST_RBF.end_of_series_ts]);h=legend('Actual Value (Testing)','RBF Predicted (Testing)','ST-RBF Predicted (Testing)','Location','Best');grid minorxlabel('Sample #','FontSize',ST_RBF.fsize);ylabel('Magnitude','FontSize',ST_RBF.fsize);set(h,'FontSize',12)set(gca,'FontSize',13)saveas(gcf,strcat('Time_SeriesTesting.png'),'png')% Objective function (MSE) (training phase)figureplot(RBF.start_of_series_tr:RBF.end_of_series_tr-1,10*log10(RBF.I(1:RBF.end_of_series_tr-RBF.start_of_series_tr)),'+-b','linewidth',RBF.lw)hold onplot(ST_RBF.start_of_series_tr:ST_RBF.end_of_series_tr-1,10*log10(ST_RBF.I(1:ST_RBF.end_of_series_tr-ST_RBF.start_of_series_tr)),'+-r','linewidth',ST_RBF.lw)h=legend('RBF (Training)','ST-RBF (Training)','Location','North');grid minorxlabel('Sample #','FontSize',ST_RBF.fsize);ylabel('MSE (dB)','FontSize',ST_RBF.fsize);set(h,'FontSize',12)set(gca,'FontSize',13)saveas(gcf,strcat('Time_SeriesTrainingMSE.png'),'png')% Objective function (MSE) (test phase)figureplot(RBF.start_of_series_ts+RBF.time_steps:RBF.end_of_series_ts,10*log10(RBF.I(RBF.end_of_series_tr-RBF.start_of_series_tr+1:end)),'.:b','linewidth',RBF.lw+1)hold onplot(ST_RBF.start_of_series_ts+ST_RBF.time_steps:ST_RBF.end_of_series_ts,10*log10(ST_RBF.I(ST_RBF.end_of_series_tr-ST_RBF.start_of_series_tr+1:end)),'.:r','linewidth',ST_RBF.lw+1)h=legend('RBF (Testing)','ST-RBF (Testing)','Location','South');grid minorxlabel('Sample #','FontSize',ST_RBF.fsize);ylabel('MSE (dB)','FontSize',ST_RBF.fsize);set(h,'FontSize',12)set(gca,'FontSize',13)saveas(gcf,strcat('Time_SeriesTestingMSE.png'),'png')% Mean square error[[10*log10(((RBF.f_train'-RBF.y_train)*(RBF.f_train'-RBF.y_train)')/length(RBF.y_train)) ...10*log10(((RBF.f_test'-RBF.y_test)*(RBF.f_test'-RBF.y_test)')/length(RBF.y_test))];[10*log10(((ST_RBF.f_train'-ST_RBF.y_train)*(ST_RBF.f_train'-ST_RBF.y_train)')/length(ST_RBF.y_train)) ...10*log10(((ST_RBF.f_test'-ST_RBF.y_test)*(ST_RBF.f_test'-ST_RBF.y_test)')/length(ST_RBF.y_test))]]

3 仿真结果

4 参考文献

[1]乐励华, 温荣生, 朱辉. 基于RBF神经网络的股市预测及MATLAB实现[J]. 科技情报开发与经济, 2008.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

新手求助RBF神经网络数据预测问题-数据.xls 本程序用前六个数据预测下一数据,前200组数据用于训练,用后80组数据进行预测,可预测结果为一个值,请大家指教: 源程序为: clc clear close all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %每五个数据整合, x=xlsread; n=length m=5; sum=0; j=1; x1=zeros); for k=1:m:n     for i=k:         sum=sum x;     end     x1=sum;     j=j 1;     sum=0; end j t=1:; figure plot;%,'d-m' hold on; grid on title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %归一化处理 [x2,mint,maxt] = premnmx figure plot;%,'d-m' hold on; grid on title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %输入数据 for k=1:1:200     p_train=[x2 x2 x2 x2 x2 x2]; 5*6     t_train=x2; 5*1 end     p_train=p_train'; %6*195     t_train=t_train'; %1*195 for z=1:1:81     p_test=[x2 x2 x2 x2 x2 x2];     t_test=x2; end      p_test=p_test';      t_test=t_test'; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %建立 RBF 网络                      goal = 0.0001;                     % 训练误差的平方和 spread = 0.01;                     % 此值越大,需要的神经元就越少 MN = size;              % 最大神经元数 DF = 1;                            % 显示间隔 net = newrb; data_out=sim p_mse=mse figure plot hold on plot title; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %预测并作图 y=sim y_mse=mse figure plot; hold on; plot title; legend;
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值