Dears.. I am doing multi step foecasting for wind speed for my university project.. but I am stuck… so I used simple data "y=x^2" to check the output as I need to understand how multi step is done when I am using close loop..
read almost all post regarding narx, but still I did not reached to what I am looking for..
I want to undertand the multi step procedure so it will be easy for me to use it on my data..
I have wind speed data for 1.5 year and external inputs I am using " pressure, humidity, and temperature " I am getting the one step ahead prediction and its working with fine, but I need to know how I can get 30 mint ahead prediction which is 3 step ahead for my data as my data interval is for 10 mint.
however, I used simple data to check 1st how multi step is working so that I can use it for my data.. kindly check below codes when I used closed loop with delay I got the outputs (square) of the input ( for last step it was approximately 400 as square of 20) and when I used the remove delay function, then I got the last step output one step ahead ( for 20 I got square of 21 ) this what I wanted.. but how to get 3 step ahead, for example if last input is 20, I want to get output for 23 ??
please support//
x=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; y=[1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400];inputSeries = con2seq(x);targetSeries = con2seq(y);inputDelays = 1:2;feedbackDelays = 1:2;hiddenLayerSize = 10;net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize);[inputs,inputStates,layerStates,targets] = preparets(net,inputSeries,{},targetSeries);net.divideParam.trainRatio = 70/100;net.divideParam.valRatio = 15/100;net.divideParam.testRatio = 15/100;[net,tr] = train(net,inputs,targets,inputStates,layerStates);outputs = net(inputs,inputStates,layerStates);errors = gsubtract(targets,outputs);performance = perform(net,targets,outputs)figure, plotperform(tr)figure;plot (cell2mat (targets),'r');holdplot(cell2mat (outputs) ,'b');netc = closeloop(net);netc.name = [net.name ' - Closed Loop'];view(netc)[xc,xic,aic,tc] = preparets(netc,inputSeries,{},targetSeries);yc = netc(xc,xic,aic);perfc = perform(netc,tc,yc)figure;plot (cell2mat(tc),'r');holdplot(cell2mat (yc),'b');nets = removedelay(net);nets.name = [net.name ' - Predict One Step Ahead'];view(nets)[xs,xis,ais,ts] = preparets(nets,inputSeries,{},targetSeries);ys = nets(xs,xis,ais);earlyPredictPerformance = perform(nets,ts,ys)figure;plot (cell2mat (ts),'r');holdplot(cell2mat (ys),'b');
Many Many Thanks// BR// Saira AL Zadjali
Best Answer