NARX multi step predictions for external test data by using training data?

1 view (last 30 days)
I am trying to build a network to do some long term predictions. I've uploaded the data and the network architecture. My data is comprised of two datasets (training and test subsets as attached). NARX neural network is used for training Input_Data and Output_Data. Then I tried to make multiple step predictions for test set (Input_Data1 and Output_Data1) by using trained net function but I cannot do predictions longer than length of test day and the predictions are very poor. When I replace the test input data with train data to predict output time steps as {x2 = X(1,predictOutputTimesteps); >> x2 = X2(1,predictOutputTimesteps);} and {LI=length(Input_Data1); >> LI=length(Input_Data);}, the result follows same pattern with train data.
How can I correctly form multi step predictions for test data by using net functions of training data?
I hope I was clear in my query.
  6 Comments
Greg Heath
Greg Heath on 14 May 2015
>Please, import the data as tables.
I have no idea what that means.
Please give me the commands to read these 4 data files into matrices.
Oguz BEKTAS
Oguz BEKTAS on 21 May 2015
Hi I am a bit confused after i saw your last comment which you wrote after your answer below. I added the data on pro_d.m file and the M_prediction.m is the NARX prediction file. I tried to look at your answer and the correlation and crosscorrelation functions but I could not understand how it is related. Recently, I have received some values after I fitted the Output_data but they are very poor. I would be very grateful if you can explain your answer more. Regards

Sign in to comment.

Accepted Answer

Greg Heath
Greg Heath on 14 May 2015
Edited: Greg Heath on 14 May 2015
I have found several problems with your exercise.
You will see the major problem if you just plot your data.
You should also see that your choice of lags and number of hidden nodes may be inadequate.
Look at the correlation and crosscorrelation functions to determine an effective subset of lags.
Thank you for formally accepting my answer
Greg
  3 Comments
Greg Heath
Greg Heath on 24 May 2015
Search the NEWSGROUP and ANSWERS with
greg NARXNET nncorr
Pay special attention to the tutorial.
Oguz BEKTAS
Oguz BEKTAS on 11 Sep 2015
Hi
I looked at your codes on the the correlation and crosscorrelation functions to determine an effective subset of lags and applied them to my input and target series. It gave successful results but so what??? In the answers and newsgroups, I could not find how to use these vectors in narxnet training.
What is the point that I am missing? Can you tell me what can I do after the code below?
X = zscore(cell2mat(x));
T = zscore(cell2mat(t));
[ I N ] = size(X)
[ O N ] = size(T)
crosscorrXT = nncorr(X,T,N-1);
autocorrT = nncorr(T,T,N-1);
crosscorrXT(1:N-1) = []; % Delete negative delays
autocorrT(1:N-1) = [];
sigthresh95 = 0.21 % Significance threshold
sigcrossind = crosscorrXT( crosscorrXT >= sigthresh95 )
sigautoind = autocorrT( autocorrT >= sigthresh95 )
inputdelays = sigcrossind(sigcrossind <= 35)
feedbackdelays = sigautoind(sigautoind <= 35)
feedbackdelays(1)=[] % Delete zero delay

Sign in to comment.

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows 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!