Preparing data for time series forecasting using NAR networks

Hello,
I am trying to use the NN toolkit for tide forecasting from an historic record of water level (<http://tracer.lcc.uma.es/problems/tide/tide.html)>. So, basically this is a problem of time series forecasting.
I wanted to use a NAR network to predict the next tide level given the past X records. Since I never used the NN toolkit before, I used the user interface (ntstool) to build the NAR network and I got pretty good results.
However, when reviewing the script that the GUI generates I can't understand the output produced by the command preparets: It seems to use the input value to the network as the value to predict, which obviously is not useful at all!
These are the first 10 values from my TS:
targetSeries = {
-0.0801
-0.6075
-0.8184
-0.6778
-0.1856
0.5176
1.3966
2.2052
2.8029
3.0490
...
};
I prepared the data using the following command:
[inputs, inputStates, layerStates, targets] = preparets(net, {}, {}, targetSeries);
The NAR network uses 3 delayed feedbacks, and this are the first elements from the inputs vector (the input to the network) and the targets vector (the desired output):
inputs = {
-0.6778
-0.1856
0.5176
1.3966
2.8029
3.0490
2.8029
2.2052
1.2208
...
};
targets = {
-0.6778
-0.1856
0.5176
1.3966
2.8029
3.0490
2.8029
2.2052
1.2208
...
};
As you can see, the targets of the NN match the inputs, but this is not what I want. What I want is to predict the NEXT value, it does not make any sense to predict the current input of the neural network in this context!
What is wrong with my procedure? Does the training of the NAR network assume this delay or something? What would you recommend to solve my problem (tide prediction)?
Thank you very much!

 Accepted Answer

What you have done so far is correct.
However, my advice is whenever you design times series, kill the default random data division specification net.divideFcn = 'dividerand' which ruins the uniform data spacing and the corresponding correlations between data points. I usually specify divideblock (help/doc divideblock). However, if you want the trn, val and tst subsets be interleaved at the expense of tripling the uniform data spacing, you can use 'divideint'. Arbitrary spacings can be specified using 'divideind'.
After completing the open loop design, you need to convert it to a closed loop design (help/doc closeloop) so that it will predict beyond the design data.
If the closed loop design doesn't perform well, you can train it with the original design data WITHOUT REININTIALIZING THE WEIGHTS.
Hope this helps.
Thank you for formally accepting my answer
Greg

2 Comments

Hi Greg,
Thanks for your answer. I already got rid off the dividerand as you said. Thanks for conforming that using it was nonsense.
However, I still do not understand the target match the inputs at the exact same time. I mean, in that scenario, if I want to achieve a 0 MSE, I only have to output the input as is! This does not make much sense either, isn't?
Thank you, Joan.
You are trying to interpret the openloop design as a final design. It isn't. The closed loop design is the final design.
Anyway, the input to the openloop design is [ Xi Xs ] which preserves the causal delay between input and output.

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox 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!