Multi-step ahead forecasting - Artificial Neural Network for time series

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

You are very much off base.
0. data = training + nontraining
nontraining = validation + testing + unseen
data = design + nondesign
design = training + validation
nondesign = testing + unseen
1.The basic difference between openloop (OL) and closeloop (CL):
a. OL uses (known) target data. Design is relatively quick
and simple.
b. CL uses fedback output data. Design can be relatively
long and frustrating.
c. CL designs are used to predict beyond the target data
d. Easiest way to obtain CL designs is to close the loop
on OL designs
2. Use DIVIDEBLOCK:
net.divideFcn = 'divideblock';
a. trainInd = 1:Ntrn
i. Calculate the SIGNIFICANT autocorrelation
lags using e.g., NNCORR
ii. Use above info to determine feedback delays,
FD(e.g., FD = 1:d)
iii. Given FD, determine the minimum number of
hidden nodes, H that will yield a satisfactory
OL design
b. valInd = Ntrn+1 : Ntrn+Nval
i. Prevent overtraining an overfit net via
Validation Stopping
ii. Rank multiple designs via SLIGHTLY BIASED
performance estimates
c. testInd = Ntrn+Nval+1 : N
i. Obtain UNBIASED estimates of performance
on nontraining (e.g., test + unseen ) data
3. It will help us help you if you try your code on one or more of the MATLAB example datasets
help nndatasets
doc nndatasets
4. I have many posts both in the NEWSGROUP and ANSWERS that explain the details with examples. For example, searching
NEWSGROUP ANSWERS
greg nncorr 14 72
greg narnet 40 145
Start with the most recent posts and work your way backward. Post all questions. Send new post alerts to my email.
Hope this helps.
Thank you for formally accepting my answer
Greg

1 Comment

It looks your understanding of validation and testing data is reversed. Reread what I have written: Validation is part of the design process. Therefore it's results are biased. However, it is not directly involved in estimating weight values. Therefore, it is only slightly biased.
Test data estimates are completely unbiased.
Training, validation and test results are obtained with one call of TRAIN and are stored in the training record TR.

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 17 Mar 2016

Commented:

on 18 Mar 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!