What is the differences between predict and forecast value ?
Show older comments
i have a targetSeries and i wanna forecast next value.i calculate autocorrelation and find feedbackDelay in narnet. testdata is %30 of TargetSeries,traindata is %70 of targetSeries and myMape is about 3.18 of prediction but when i forecast for last %30 myMape is about 14.30. what is the differences between predict and removedelay ? 2-How can i select best FeedbackDelay?
N = length(TargetSeries);
zt = zscore(TargetSeries,1);
autocorrt = nncorr( zt, zt, N-1, 'biased' );
[ sortact FeedbackDelay] = sort(autocorrt(N:end),2,'descend');
for i=1:length(sortact)
if(sortact(1,i)>=0.80)
feedbackDelay(1,i)=FD(1,i);
end
end
feedbackDelay = sort(feedbackDelay);
net = narnet(feedbackDelay,hiddenLayerSize,'open',trainFcn);
%train
[net tr Ys Es Xf Af] = train(net,inputs,targets,inputStates,layerStates);
%test
yPrediction = net(testdata,inputStates,layerStates);
%MAPE
MAPE=(sum(abs(abs(OrijinalTestNumbers-yPredictionNumbers)./OrijinalTestNumbers))/length(OrijinalTestNumbers))*100;%about 4.23
Forecast = traindata;
for i=1:testLength
nets = removedelay(net2);
[xs,xis,ais,ts] = preparets(nets,{},{},Forecast);
ys = nets(xs,xis,ais);
Forecast(1,end+1) = ys(1,end);
i
end
Thank you for helps.
Answers (0)
Categories
Find more on Signal Modeling 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!