Neural Network - Multi Step Ahead Prediction
이전 댓글 표시
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
Greg Heath
2018년 1월 31일
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
2018년 2월 2일
편집: Emerson Abraham
2018년 2월 2일
Greg Heath
2018년 2월 3일
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
2018년 2월 6일
Greg Heath
2018년 2월 13일
편집: Greg Heath
2018년 2월 13일
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
2018년 2월 13일
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
2018년 2월 16일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!