What is the differences between predict and forecast value ?
2 views (last 30 days)
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.
0 Comments
Answers (0)
See Also
Categories
Find more on Modeling and Prediction with NARX and Time-Delay Networks 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!