该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

请问吧里有大神做过MATLAB时间序列神经网络(NARX)吗?请教一下该神经网络的预测问题

我用网上的一个案例:知道2015年降雨我要预测该年水位。用往年的降雨与水位数据训练好网络后该怎么做预测。

代码如下;在这之后该怎么加载训练好的网络以及新的输入来预测输出呢?请高手解答一下,谢谢!

clear all

% Solve an Autoregression Problem with External Input with a NARX Neural Network

% Script generated by Neural Time Series app

% Created Thu Jun 08 14:20:08 CST 2017

%

% This script assumes these variables are defined:

%

% rain - input time series.

% water - feedback time series.

rawData=xlsread('R26-3.xlsx','sheet1','B2:D241');

rain=rawData(:,3);

water=rawData(:,2);

X = tonndata(rain,false,false);

T = tonndata(water,false,false);

% 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 with External Input

inputDelays = 1:4;

feedbackDelays = 1:4;

hiddenLayerSize = 10;

net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize,'open',trainFcn);

% Choose Input and Feedback Pre/Post-Processing Functions

% Settings for feedback input are automatically applied to feedback output

% For a list of all processing functions type: help nnprocess

% Customize input parameters at: net.inputs{i}.processParam

% Customize output parameters at: net.outputs{i}.processParam

net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};

net.inputs{2}.processFcns = {'removeconstantrows','mapminmax'};

% Prepare the Data for Training and Simulation

% The function PREPARETS prepares timeseries data for a particular network,

% shifting time by the minimum amount to fill input states and layer states.

% Using PREPARETS allows you to keep your original time series data unchanged, while

% easily customizing it for networks with differing numbers of delays, with

% open loop or closed loop feedback modes.

[x,xi,ai,t] = preparets(net,X,{},T);

% Setup Division of Data for Training, Validation, Testing

% The function DIVIDERAND randomly assigns target values to training,

% validation and test sets during training.

% For a list of all data division functions type: help nndivide

net.divideFcn = 'dividerand'; % Divide data randomly

% The property DIVIDEMODE set to TIMESTEP means that targets are divided

% into training, validation and test sets according to timesteps.

% For a list of data division modes type: help nntype_data_division_mode

net.divideMode = 'value'; % Divide up every value

net.divideParam.trainRatio = 70/100;

net.divideParam.valRatio = 15/100;

net.divideParam.testRatio = 15/100;

% Choose a Performance Function

% For a list of all performance functions type: help nnperformance

% Customize performance parameters at: net.performParam

net.performFcn = 'mse'; % Mean squared error

% Choose Plot Functions

% For a list of all plot functions type: help nnplot

% Customize plot parameters at: net.plotParam

net.plotFcns = {'plotperform','plottrainstate','plotresponse', ...

'ploterrcorr', 'plotinerrcorr'};

% Train the Network

[net,tr] = train(net,x,t,xi,ai);

% Test the Network

y = net(x,xi,ai);

e = gsubtract(t,y);

performance = perform(net,t,y);

matlab神经网络 时间序列,请问吧里有大神做过MATLAB时间序列神经网络(NARX)吗?...相关推荐

  1. matlab narxnet,请问吧里有大神做过MATLAB时间序列神经网络(NARX)吗?

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 请问吧里有大神做过MATLAB时间序列神经网络(NARX)吗?请教一下该神经网络的预测问题 我用网上的一个案例:知道2015年降雨我要预测该年水位.用往年 ...

  2. matlab 连续两个if,求大神解答一个matlab中的for循环嵌套if选择语句

    公告: 为响应国家净网行动,部分内容已经删除,感谢读者理解. 话题:求大神解答一个matlab中的for循环嵌套if选择语句回答:1.最后缺少一个end;2.这句输出没什么意义:disp A(i)=A ...

  3. java 歌词_请问吧内有大神用JAVA做过桌面歌词吗

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 写了个简单的例子给你: public class TextChangePane extends JComponent implements ActionL ...

  4. 红警自建服务器,有大神做了个网页版的红警2,方便打工人上班摸鱼

    mumu丨文 前段时间愚人节的时候看到个游戏新闻,说是国外有个叫Chrono Divide的项目,作者用Java重写了红警2的核心程序,复刻了一个红警2页游出来. 是的,你没看错,你可以在网页上与别人 ...

  5. matlab拟合二元函数图,求助大神。。matlab拟合二元函数,求解系数。函数形式已知...

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 y x2 x1 449083.6 12.96479 9503.75 442743.7 12.12091 9529.59 446092.7 12.29292 ...

  6. matlab里exist是什么意思,通达信exist函数用法,exist()函数在matlab中怎么用?求教大神~...

    Q1:exist()函数在matlab中怎么用?求教大神~ exist name 等价于 r=exist(name) ,在程序里面这样更加实用 0 不存在则返回值 1 name 可以是变量名,如果存在 ...

  7. Matlab/Simulink中的S函数模块嵌入人工智能、神经网络算法设计仿真案例详解(以基于RBF神经网络算法的VSG转动惯量自调节为例)

    参考文献 An improved virtual synchronous generator power control strategy  Deep reinforcement learning b ...

  8. 产品大神有张小龙,为什么运营少有大神?

    在互联网产品领域,我们经常会说到缔造微信的张小龙,称之为产品大神,也会经常谈起孕育贴吧的俞军.打造QQ的马化腾,也会对雷军.周鸿祎.傅盛等优秀产品的CEO在一些产品上的洞见津津乐道. 但当我们回头看运 ...

  9. ubuntu14.04扩展屏幕后,打开matlab就死机。求大神帮忙解决!!!万分感谢

    ubuntu14.04扩展屏幕后,打开matlab就死机.求大神帮忙解决!!!万分感谢

最新文章

  1. 71道Android开发面试题
  2. Swift - 类型属性(类静态属性)和类方法(类静态方法)
  3. Oracle全文索引之三 检索
  4. Linux学习总结(七十四)自动化运维之ansible
  5. USB转RS232串口应用
  6. Swift5使用KVC报setValue:forUndefinedKey
  7. Photoshop: 将图片转换成psd格式
  8. iOS 中的常用设计模式总结
  9. 公共WiFi到底该不该连?
  10. 天津发票版本文件服务器端口,天津增值税发票综合服务平台入口
  11. web常见的 HTTP 5xx 状态汇总
  12. php实现易班登录,简单的易班申请授权以及使用方式
  13. 2021阿里云申请免费SSL证书最新流程
  14. python编程计算圆面积math_python编程计算圆面积
  15. ESP32 VHCI架构实现BLE扫描设备
  16. h5 html页面百度定位当前位置不准
  17. 十八种让你有用的饲料配方
  18. revit二次开发的一些前期准备
  19. SpringBoot学生成绩管理系统
  20. 工作站,服务器和普通电脑的区别

热门文章

  1. ArcGIS对AutoCAD操作的图文教程
  2. 新的一年,,,新的生活
  3. 见了很久没见的高中同学,真好
  4. SpringBoot启动类的扫描注解的用法及冲突原则
  5. 高校选课成绩管理系统
  6. 每日算法练习之下落的小球
  7. 算法每日练习之判断完数
  8. KeyValueTextInputFormat使用案例
  9. Windows应用程序进程级别统一监控实践
  10. 基于微信的图片放大预览