MATLAB: Narx delays problem & multistep ahead predictions

delay problemmulti-step predictionnarxnarxnetnncorr

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?

Best Answer

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