Narx delays problem & multistep ahead predictions
1 view (last 30 days)
Show older comments
Attached includes my datasets and NARX network architecture. The data is comprised of two datasets (training and test subsets )and I am trying to make multi-step predictions for the external test data subset by using the internal training data subset. As all the data curves have exponential growth,Narx model is confused with this type of growth and gave very inaccurate results. Then, I used the difference equation for exponential growts (a=x(i)/x(i-1)) to transform the data in a form that NARX can make meaningful predictions and it worked well in the model. However, now, the results are not always coherent and can come up with low performance of training. I suppose the problem is about Crross correlation between neural network time series (nncorr). I tried to find a solution from Greg's answers and tutorials and found the following code
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
In the original code with the simple data set, feedback delays only results with 1,2 and 3 and entered as 1:3 but in my case the results are much more different than that.
feedbackdelays=[0.227215651811241,0.233970150901862,0.284917894683197,0.264096206558765,0.393205223678322,0.574922519886786,0.294921921143733,0.270700384072885];
What is the point that I am missing? Can anyone tell me what can I do with the code above?
0 Comments
Accepted Answer
Greg Heath
on 23 Oct 2015
The version of the code you are using is both dated and error prone. Check both the NEWSGROUP and ANSWERS for the latest version.
Also: You are mistaking correlation values for correlation lags.
Hope this helps.
Thank you for formally accepting my answer
Greg
4 Comments
Greg Heath
on 25 Oct 2015
When you refer to my code, PLEASE give the EXACT reference. (Since I have thousands of posts, the reasons are obvious).
AFAIK, there is no direct method for optimizing the ID, FD, H combination. My common sense indicates that the choices of FD and ID should be GUIDED by the knowledge of all of the significant lags. Plots of the correlation functions with the significant correlations highlighted with red circles can be quite helpful in making the choice.
Just keep in mind that the number of unknown weights increases with the number of delays and hidden nodes. That is why I defined Hub as a measure of quantifying the onset of overfitting and I use the val subset to prevent overtraining an overfit net. If H << Hub is not feasible, an alternative, of course is to use regularization via MSEREG and/or TRAINBR.
More Answers (0)
See Also
Categories
Find more on Modeling and Prediction with NARX and Time-Delay Networks 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!