The code you are using wastes time and space by making unneccesary assignments of variables to their default values. A better approach is to begin with the code that is in
help narxnet
doc narxnet
and
search the NEWSGROUP and ANSWERS for previously posted work.
For example
NEWSGROUP ANSWERS
narxnet 90 321
greg narxnet 71 251
A couple of quick look comments:
1. FOR loops are better than WHILE loops. Less chance of an infinite loop.
2. The loop is started in wrong place. All you have to loop over is number of hidden nodes and initial random weights. As a result most of your calculations are meaningless repetitions.
3. DIVIDEBLOCK is the correct datadivision mode for unbiased constant timestep prediction. Therfore your comment "Divide data randomly" is incorrect.
help divideblock
doc divideblock
4. You don't reveal any numerical information (I,O and resulting performance values)
5. A good openloop target for narxnet is R^2 >= 0.995 or R >= 0.9975. Your target of R>= 0.9 is woefully inadequate (R^2 > 0.81).
6. Take a look at some of my posts. Especially the NEWSGROUP posts over the past year or so.
Hope this helps.
Thank you for formally accepting my answer
Greg
