How to generate predictions with NARX?

1 view (last 30 days)
Ziheng Wang
Ziheng Wang on 21 Dec 2015
Commented: Greg Heath on 21 Dec 2015
Hello,
I have a very simple question regarding NAR usage. I understand from the tutorials how to train a neural network on given target series. Can somebody confirm that my approach to predict future values in out of sample test set is correct?
targetSeries = tonndata(C,true,false); feedbackDelays = 1:5; hiddenLayerSize = 10; net = narnet(feedbackDelays,hiddenLayerSize); [inputs,inputStates,layerStates,targets] = preparets(net,{},{},targetSeries); net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; [net,tr] = train(net,inputs,targets,inputStates,layerStates);
C2=[a,b,c,d,e] (a,b,c,d,e are five consecutive values from out of sample test set) targetSeries = tonndata(C2,true,false); [xs,xis,ais,ts] = preparets(nets,{},{},targetSeries); ys = nets(xs,xis,ais);
Will ys be the prediction generated for the sixth value that comes after a,b,c,d, and e?
Thank you very much.
  1 Comment
Greg Heath
Greg Heath on 21 Dec 2015
Why don't you just try the code on some of the MATLAB timeseries example data ???
help nndatasets
doc nndatasets
In particular, the simplenar_dataset!
If you have problems you can post details and we can help.
Hope this helps.
Greg

Sign in to comment.

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!