One step ahead prediction using NARX networks

6 views (last 30 days)
Thanks in advance for helping me. I am totally new to Matlab and to Neural Networks. I searched in google and in different forums but I still have doubts about a couple of things.
I am trying to program a NN that returns a prediction for prices of a commodity for the next day when introducing 7 different technical indicators and the closing price of the previous day. It is a project for university so it does not really matter much how accurate it predicts.
My doubts are the following ones:
1)I programmed and trained a NARX network:
if true
% code
end
%%TRAINS AND CREATES A ONE STEP AHEAD NEURAL NETWORK
%%Takes the data
X = tonndata(transpose(INPUT),true,false);
T = tonndata(transpose(OUTPUT3),true,false);
%%narxnet(inputDelays,feedbackDelays,hiddenSizes,trainFcn) takes these arguments
net = narxnet(1:1,1:1,8,'none','trainbr');
[Xs,Xi,Ai,Ts] = preparets(net,X,{},T);
net = train(net,Xs,Ts,Xi,Ai);
Y = net(Xs,Xi,Ai);
perf = perform(net,Ts,Y)
%%Creates the One-Step-Ahead network
netp = removedelay(net);
netp.name = [net.name ' - Predict One Step Ahead'];
[Xs,Xi,Ai,Ts] = preparets(netp,X,{},T);
Y = netp(Xs,Xi,Ai);
stepAheadPerformance = perform(netp,Ts,Y)
view(netp)
¿Should I train the removedelay network also? ¿Or with the first NARX training is enough?
2)If I need to predict one step ahead. ¿How can I call the NN without using any output data? Because I am not suppose to have them yet.
if true
% code
end
%%Takes the data
X = tonndata(transpose(INPUTtest),true,false);
T = tonndata(transpose(OUTPUTtest),true,false);
%%Returns the results
[Xs,Xi,Ai,Ts] = preparets(netp,X,{},T);
RESULTS = netp(Xs,Xi,Ai);
Thank you very much in advance. I know that they are probably basic questions, but I felt lost.

Accepted Answer

Greg Heath
Greg Heath on 21 Mar 2017
Edited: Greg Heath on 21 Mar 2017
I HAVE COVERED MOST ASPECTS OF NARXNET DESIGN
SEARCHWORDS HITS
NEWSGROUP ANSWERS
GREG NARX 53 231
GREG NARXNET 75 276
NARX 86 379
NARXNET 94 359
Since there will be many duplicates, the best bet is to search by category size ( i.e., 53, 75, ...,359, 379) IN REVERSE CHRONOLOGICAL ORDER !
Hope this helps.
Thank you for accepting my answer
Greg
P.S. Do not overlook the importance of using the auto and cross correlation functions to determine the statistically significant lags. It is not recommended to just assume how many and which lags are significant.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!