MATLAB: NAR Neural network predict Y(t+1) value

Deep Learning ToolboxMATLABneural networktime series prediction

Hi all, I am writing down a script matlab to try to use NAR neural network.
Let's suppose net is my network just created, also suppose that y is my array of values. NAR are used to predict y(t) starting from y(t-1), y(t-2), … ,y(t -n) where n is the delay.
Let's suppose I have K values, If I run my net I will get K – n values (first n values are not computable, because of the delays ), ok? But If I want get the K +1 value (effective prediction), how can I do?
I have been thinking that to compute the K +1 value my net would use just the K, K-1, …K-n values of my y, so I could set my y(k+1) in a random way.
Am I wrong?

Best Answer

If you are limited to no more than n feedback delays, only use the 1 <= d <= n (not necessarily consecutive) delays that correspond to statistically significant correlations of the autocorrelation function of y. Examples can be found by searching NEWSGROUP and ANSWERS using
greg narnet nncorr
Then using
[ net tr Ys Es Xf Af ] = train( net, Xs, Ts, Xi, Ai);
yields the initial conditions Xf, Af for predicting beyond the original data.
However, you will probably have to close the feedback loop and continue training netc to reduce error propagation and extend the range of out-of-sample predictions.
For example, search NEWSGROUP and ANSWERS with
narnet closeloop
and
greg narnet closeloop
Hope this helps.
Thank you for formally accepting my answer
Greg