Neural Network - Multi Step Ahead Prediction
Afficher commentaires plus anciens
I built a NAR Neural Network using Neural Network Toolbox and after training it was provided an algorithm to do simulations, such as: Multi-Step prediction and Step-Ahead prediction. However, I would like to do Multi-Step Ahead Predictions (five steps) and it was not provided by the assistent. Could anybody help me ?
Below you can see part of the code provided by Matlab
T = tonndata(input,true,false);
[x,xi,ai,t] = preparets(net,{},{},T);
% Closed Loop Network
netc = closeloop(net);
netc.name = [net.name ' - Closed Loop'];
view(netc)
[xc,xic,aic,tc] = preparets(netc,{},{},T);
yc = netc(xc,xic,aic);
closedLoopPerformance = perform(net,tc,yc)
% Step-Ahead Prediction Network
nets = removedelay(net);
nets.name = [net.name ' - Predict One Step Ahead'];
view(nets)
[xs,xis,ais,ts] = preparets(nets,{},{},T);
ys = nets(xs,xis,ais);
stepAheadPerformance = perform(nets,ts,ys)
Thank you very much
7 commentaires
Greg Heath
le 31 Jan 2018
You cannot train a net, then be given an arbitrary set of data and expect anything useful to result.
Or am I missing something?
Greg
Emerson Abraham
le 2 Fév 2018
Modifié(e) : Emerson Abraham
le 2 Fév 2018
Greg Heath
le 3 Fév 2018
If you design a net to predict 1 step a head, you have to call it 5 times to predict 5 points a head.
Alternatively, you can design it to predict 5 steps ahead.
Just use the given algorithm.
Greg
Emerson Abraham
le 6 Fév 2018
Greg Heath
le 13 Fév 2018
Modifié(e) : Greg Heath
le 13 Fév 2018
You can, but why not just train it for 5 timesteps instead of the default?
Or, why not educate yourself and do both?
Greg Heath
le 13 Fév 2018
It is VERY DIFFICULT to be sure that comments and answers are accurate when you only post sections of code.
In addition, if you want to compare numbers, you have to include the initial state of the random number generator. I typically use
rng(0) or rng('default')
before training the first of multiple designs.
Emerson Abraham
le 16 Fév 2018
Réponses (0)
Catégories
En savoir plus sur Sequence and Numeric Feature Data Workflows dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!