What is the differences between predict and forecast value ?
Afficher commentaires plus anciens
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.
Réponses (0)
Catégories
En savoir plus sur Signal Modeling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!