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

请问吧里有大神做过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 preparets,请问吧里有大神做过MATLAB时间序列神经网络(NARX)吗?相关推荐

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

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

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

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

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

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

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

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

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

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

  6. 电子计算机上gt键的功能,请问计算器里的GT键是做什么用的

    公告: 为响应国家净网行动,部分内容已经删除,感谢读者理解. 话题:请问计算器里的GT键是做什么用的?回答:再你完成一个运算后按下等号后 计算器会把你的结果算在GT这个单元里 你完成几次运算后 按下G ...

  7. 惊恐,还真有大神把地府后台管理系统做出来了,“阎王爷”疯狂点

    很早之前,有一个段子火了 没想到,真有大神把系统原型图给做出来了. 接下来就跟随大狮兄来一探究竟,这个地府后台管理系统. 登录页 登录页支持账号登录.手机登录.扫码登录三种登录方式. 首页 首页信息非 ...

  8. 惊恐,还真有大神把地府后台管理系统做出来了,“阎王爷”疯狂点赞!附地址...

    点击蓝色"涛哥聊Python"关注我丫 加个"星标",每天一起快乐的学习 作者:大狮兄   来源:w3cschool 很早之前,有一个段子火了 没想到,真有大神 ...

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

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

  10. matlab如何excel数据,Matlab如何读取Excel里的数据

    Matlab如何读取Excel里的数据呢?一起看看下面这篇文章吧! 我们可以使用xlswrite,用法是这样的:xlswrite('Excel路径+Excel的名称','需要输出的矩阵名称')当然,如 ...

最新文章

  1. BigDecimal 使用详解
  2. Android开发--图形图像与动画(三)--Animation效果的XML实现
  3. 2019春季季节跳动招聘笔试(回忆版)第二题
  4. 面向在线教育业务的流媒体分发演进
  5. javascript中对一个对象数组按照对象某个属性进行排序
  6. 美团数据平台Kerberos优化实战
  7. 破坏计算机信息系统功能罪,破坏计算机信息系统罪
  8. ASP.Net下使用ExtJS报“Ext未定义”错误的原因
  9. linux shell 后台执行脚本的方法 脚本后台运行 后台运行程
  10. Android--hardwareAccelerated 硬件加速详解 android:largeHeap=true
  11. 008-对象—— 对象$this self parent 内存方式及使用方法讲解
  12. 英语文章翻译-英语文章翻译软件-免费批量翻译
  13. ToolBar修改返回按钮图标,CollapsingToolbarLayout修改文字居中
  14. matlab结构力学仿真,MATLAB在结构力学分析中应用.doc
  15. 比例谐振(PR)控制
  16. dive into deep learning 循环神经网络 RNN 部分 学习
  17. RabbitMQ学习总结(六)之消息应答
  18. js实现qq好友分组
  19. Vue项目覆盖率展示
  20. XBee系列模块户外通信距离测试指南

热门文章

  1. java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGCodec
  2. Array对象的三种属性实例
  3. NETSCREEN用L2TP方式建立×××
  4. 软件工程导论 四则运算
  5. SDUT 2482 二叉排序树
  6. 神奇DP [HNOI2004] 打砖块
  7. python:关于三级菜单的新手实现
  8. 安卓android eclipse运行提示no compatible targets were found
  9. SQL多表合并查询结果
  10. 浅谈数据结构-二叉树