How can I make a t+10 prediction with NARX networks?

1 view (last 30 days)
Hi,
I am trying to make a t+10 step ahead prediction of sudden drop in solar radiation. My data base has minute steps time series of average solar radiation (in each minute), the largest derivative occurring at that minute, standard deviation of radiation and average of solar height.
I have already read the MATLAB NARX documentation and I am not sure about some concepts to know if I am working correctly with this kind of networks.
The MATLAB documentation states that to work with such networks it is best to train them in openloop mode and then close the loop to make step ahead predictions.
I don't know if it is necessary to make this prediction in closedloop mode in case the network needs to pre-calculate the steps t+1, t+2... until t+9 to calculate t+10 or just with openloop mode it could calculate that tenth step and have it at the current time with the current inputs (up to the step I have all actual inputs and outputs).
My output is a time series of zeros and ones when I consider that a big drop is starting, so I would want to predict if there is going to be any big drop in the next ten minutes ahead (or the probability of occurrence).
Am I applying well the concepts of this networks? In both cases (open and close loop) am I calculating t+10 with the exogenous 20 backwards?
Or does the network need the exogenous data in t+1, t+2 to make the tenth prediction?
Thank you in advance for your help.
delay = 10; %t+10 prediction
inputDelays = 11:20+delay;
feedbackDelays = 22:20+delay;
hiddenSizes=80;
net = narxnet(inputDelays,feedbackDelays,hiddenSizes,'open','trainlm');
net = removedelay(net,delay);
[Xo,Xi,Ai,To,shift] = preparets(net,X_train,{},Y_train);
net.divideFcn = 'divideblock';
net.divideParam.trainRatio = X;
net.divideParam.valRatio = Y;
net.divideParam.testRatio = Z;
net.trainParam.epochs = 60;
net.layers{2}.transferFcn = 'tansig';
%% Train network openloop mode
[net,info_net] = train(net,Xo,To,Xi,Ai);
%% Output openloop mode
[output_open,Xf,Af] = net(Xo,Xi,Ai);
errors = gsubtract(To,output_open);
Performance_values.perf_open = mse(net,To,output_open);
%% Output closeloop mode
net_closed = closeloop(net);
[Xc,xci,aci,Tc,shift2] = preparets(net_closed,X_test,{},Y_test);
[output_close,Xcc,acc]= net_closed(Xc,xci,aci);
Performance_values.perf_closed = mse(net,Tc,output_close);

Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows 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!