%load data
S = load('magdata');X = con2seq(S.u);T = con2seq(S.y);% DESIGN NETWORK
[x,t] = simplenarx_dataset;net = narxnet;[X,Xi,Ai,T] = preparets(net,x,{},t);net = train(net,X,T,Xi,Ai);view(net)% SIMULATE NETWORK FOR ORIGINAL SERIES
[Y,Xf,Af] = sim(net,X,Xi,Ai);% CONTINUE SIMULATION FROM FINAL STATES XF & AF WITH ADDITIONAL
% INPUT DATA USING CLOSED LOOP NETWORK.
% Closed Loop Network
netc = closeloop(net);%netc = closeloop(net,Xf,Af);
%view(netc)
% 10 More Steps for the first (now only) input
X2 = num2cell(rand(1,10));% Initial input states for closed loop continuation will be the
% first input's final states.
Xi2 = Xf(1,:);% Initial 2nd layer states for closed loop contination will be the
% processed second input's final states. Initial 1st layer states
% will be zeros, as they have no delays associated with them.
Ai2 = cell2mat(Xf(2,:));for i=1:length(net.inputs{1}.processFcns) fcn = net.inputs{i}.processFcns{i}; settings = net.inputs{i}.processSettings{i}; Ai2 = feval(fcn,'apply',Ai2,settings);endAi2 = mat2cell([zeros(10,2); Ai2],[10 1],ones(1,2));% Closed loop simulation on X2 continues from open loop state after X.
Y2 = sim(netc,X2,Xi2,Ai2);plot(1:length(t),cell2mat(t))hold onplot(1:length(x),cell2mat(x),'r')plot(length(t):length(t)+length(Y2)-1,cell2mat(Y2),'g')legend('Input data - target series','One-step ahead prediction','Multi-step prediction beyond')
MATLAB: 1. what is the minimum number of the input(Data) that u can use to train Neural Network for Multi Step Ahead Prediction?,2. how can I feed the following data to the code?,(the data are{54 60 69 73 79 80) I want to predict multi step ahead
prediction using neural network
Related Question
- How to use neural network for multi step ahead prediction
- Neural Network NAR-based time-series prediction starts failing after several timesteps
- Is it okay to use this code for trained network forecasting in NARX
- Load forecasting using NARNET
- As predicted delayed outputs settle in NarX
- Lag in output from NarNetwork (narnet)
Best Answer