• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

MATLAB时间序列预测PredictionoftimeserieswithNARneuralnetwork

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

具体请参考:http://lab.fs.uni-lj.si/lasin/wp/IMIT_files/neural/nn05_narnet/

神经网络预测时间序列数据,有三种模型,

这里是给出的是第二种NAR,即只有时间序列数据y(t),没有x(t)。具体训练和预测matlab代码如下:  

 

format compact

% data settings
N  = 249; % number of samples
Nu = 224; % number of learning samples

y = Data;% Input your data
% prepare training data
yt = con2seq(y(1:Nu)');

% prepare test data
yv = con2seq(y(Nu+1:end)');

% Choose a Training Function
% For a list of all training functions type: help nntrain
% 'trainlm' is usually fastest.
% 'trainbr' takes longer but may be better for challenging problems.
% 'trainscg' uses less memory. NTSTOOL falls back to this in low memory situations.
trainFcn = 'trainlm';  % Levenberg-Marquardt

% Create a Nonlinear Autoregressive Network
feedbackDelays = 1:5;
hiddenLayerSize = 40;
net = narnet(feedbackDelays,hiddenLayerSize,'open',trainFcn);

[Xs,Xi,Ai,Ts] = preparets(net,{},{},yt);

% train net with prepared training data
net = train(net,Xs,Ts,Xi,Ai);
% view trained net
% close feedback for recursive prediction
net = closeloop(net);
% view closeloop version of a net
view(net);

%%%Recursive prediction on test data
% prepare test data for network simulation
yini = yt(end-max(feedbackDelays)+1:end); % initial values from training data
% combine initial values and test data 'yv'
[Xs,Xi,Ai] = preparets(net,{},{},[yini yv]);

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
delphi--批量添加发布时间:2022-07-18
下一篇:
PC-飞起来!我的Windows XP——五步快速优化Windows XP - 疯狂delphi发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap