Multi-step ahead forecasting - Artificial Neural Network for time series
Show older comments
Hi, I have speed data for each 5min speed data during 10days. (10day, 288/day) With this data, I am trying to predict values of y by 12 future time-steps (t+1,t+2,t+3,t+4,t+5,t+6...t+12) with the lastest 6 speed data(t-5, t-4,...,t) for one day. I think NAR function is the best for one parameter(speed).(Input and Output are speed). If I use openloop, I can only find 5 min ahead speed(one step ahead) for one day. Right? I found closed-loop to find multi-step ahead forecasting speed but I cannot find the results for multi-steps. How can I know Multi-step ahead forecasting speeds?? They only give the result for only one step. If inputDelay is 1:6 (this means last 6data?), can I get the prediction results at future 30 minutes? If I want to get by one hour???
9days are testing data and last one day is validation data. Inputdata for tarining: 1x(2880-288) data for validation: 1x288
This is my matlab code.
N=length(historicaldata); % number of samples (testing) Nu=length(historicaldata)-288; % number of learning samples (validation) y=historicaldata;
% prepare training data
yt = con2seq(y(1:Nu)');
% prepare validation data
yv = con2seq(y(Nu+1:end)');
%---------- network parameters ------------- % good parameters
inputDelays = 1:6; % input delay vector
hiddenSizes = [10]; % network structure (number of neurons) %-------------------------------------
% nonlinear autoregressive neural network
net = narnet(inputDelays, hiddenSizes);
% [Xs,Xi,Ai,Ts,EWs,shift] = preparets(net,Xnf,Tnf,Tf,EW)
[Xs,Xi,Ai,Ts] = preparets(net,{},{},yt);
% train net with prepared training data
net = train(net,Xs,Ts,Xi,Ai);
% close feedback for recursive prediction
netc = closeloop(net);
% prepare validation data for network simulation
yini = yt(end-max(inputDelays)+1:end); % initial values from training data
% combine initial values and validation data 'yv'
[Xs,Xi,Ai] = preparets(netc,{},{},[yini yv]);
% predict on validation data
predict = netc(Xs,Xi,Ai);
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!