Hi folks,
I am using narnet to forecast one step ahead of power system load. I am using NARNET wizard. First of all, let's give it an array of ten elements and predict 11th element.
if true targetSeries = tonndata(yyt,true,false); %yyt is an array of ten elemnts:
[749.8398 739.8419 719.8462 709.8483 689.8526 709.8483 739.8419 759.8376 709.8483 739.8419] feedbackDelays = 1:9; % I am confused here, what the f**k is going on with this delay thing? if I give it 9, it forecasts the 10th point which I already have it. So I thought I would need to remove one delay to get one more forecast. Am I right?
hiddenLayerSize = 10; %whatever
net = narnet(feedbackDelays,hiddenLayerSize); %whatever [inputs,inputStates,layerStates,targets] = preparets(net,{},{},targetSeries); %same sh*t
net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; [net,tr] = train(net,inputs,targets,inputStates,layerStates);% Apparently training
outputs = net(inputs,inputStates,layerStates); %This should give me next value of my series, the dumb net just gives me the 10th point I already entered
%How about this?
net = removedelay(net,1); %Now if I train net and get the output, it gives me a 1*2 cell. Clearly, I will go with the second point as my forecast, right?
end
Alright, now let's look at what I got out of the script:
Actual 749.8397827 739.841938 719.846189 709.8483443 689.8525953 709.8483443 739.841938
One step ahead Forecast 750.0746601 749.8397827 740.2006302 719.8708696 708.7710368 689.8413695 717.4414728
Look at the bold numbers. Do you see the shifting pattern? it seems that my two step ahead forecast and actual value are almost equal. However, I do not have two step ahead forecast(e.g forecast(t=2)) unless I have the actual load of one step prior (actual(t=1)). What is going on here?
Best Answer