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
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
Emerson Abraham 2018년 2월 2일
편집: Emerson Abraham 2018년 2월 2일
Hi Greg,
My main aim is to use a Neural Network to make predictions on time series. I used the time series app provided by the Neural Network Toolbox to make predictions, considering 40 timesteps (forty years). The algorithms provided by the matlab were used to forecast each year of the serie (aiming to evaluate the error between the original data and the predicted data) and to simulate a step ahead (prediction for next year). This is ok, but I intend to do a multi-step prediction (next five years ahead) considering this network. Is it possible ? Is there any algorithm to do this ?
Thank you. Best regards
Greg Heath
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
Then, should I try a loop using "for" command ?
Thank you
Greg Heath
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?
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.
Ok, I'll do it. Thank you.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

질문:

2018년 1월 31일

댓글:

2018년 2월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by