MATLAB: Neural Network Time series – Forecast problems

neural network time series forecast

Hi all, i'm new on this forum although often I followed it to try to solve a variety of problems. This time I have not found anything that could help me and then I'm writing this message. I'm implementing a neural network (time-series) problem with the goal of making predictions. As a first implementation I used the graphical interface that offers Matlab (ntstool), I implemented the network, I have trained it and I have generated the code. Then I modified the code in order to to try to understand how it works (such as changing the number of layers, the number of neurons within each layer or by changing the learning functions). I have a good trained network with excellent graphics of error-autocorrelation, regression and performance. The problem that I have is in the generation of predictions. I have not quite clear, at the level of code, how "closeloop" works and part of the code that comes after (that is, what is the forecast for matlab one step ahead). Is there anyone who can help me in understanding this problem and possibly show me how to proceed to make t +1 and t + n predictions? Attached is the code I'm working with (for now I'm using input (y) = output (y) but the problem is also when I use input (x, y) = output (y)). One last thing: is a necessary condition that the series is stationary? or the NN does not care about unlike a normal AR model? Thanks

Best Answer

  • Always use a single hidden layer since it is a universal approximator.
    Use one or both of autocorrelation(t)and crosscorrelation(x,t) to find the significant delays to put in FD and ID, respectively.
    The number of hidden nodes can be found by trial and error. Start with the default H=10.
    After you close the loop evaluate netc on the data.
    If CL performance is worse than the OL performance, train netc.
    greg closeloop
    for examples.
    Hope this helps.
    Thank you for formally accepting my answer