网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
05月03日漏签0天
matlab吧 关注:292,720贴子:1,659,387
  • 看贴

  • 图片

  • 吧主推荐

  • 游戏

  • 8回复贴,共1页
<<返回matlab吧
>0< 加载中...

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

  • 只看楼主
  • 收藏

  • 回复
  • 轻风的叶
  • 无名之辈
    2
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
请问吧里有大神做过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);


  • 轻风的叶
  • 无名之辈
    2
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
希望来为高手解答一下啊,其他吧友也来交流一下 啊


2026-05-03 01:27:19
广告
不感兴趣
开通SVIP免广告
  • 轻风的叶
  • 无名之辈
    2
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
吧里没人能解答吗


  • Molopq
  • 初涉江湖
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
怕不是你做的太先进


  • liyunlong1166
  • 初涉江湖
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
您好,楼主,您这个问题弄明白了吗?


  • 激动的小卡尔
  • 初涉江湖
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
用自带的工具箱试试?


  • adamfzd
  • 初涉江湖
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
可能是predict或者是sim,你试试。非时间序列的可以用sim


  • lllllland1
  • 初涉江湖
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
加载net网络之后,直接用y=net(x)啊


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 8回复贴,共1页
<<返回matlab吧
分享到:
©2026 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示