Increasing Accuracy of Univariate NARNET Time series
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Please I ran this code for a univariate prediction but the seasonality in my result has a wide gap between the actual and predicted. What can I do to improve the accuracy. Love to hear from you.
clear;clc;
Xall= xlsread('APB.xlsx','Autumn','b2:b277');
Y=Xall(1:256,1);
% X=cell2mat(X);
Xtest= Xall(257:276,1);
% T = tonndata(X,false,false);
net = narnet(1:3,25); % creates the autoregressive NN
net.trainParam.showWindow = true; % shows the training window
T = tonndata(Y,false,false); % converts the data to a ANN cell array form.
[Xs,Xi,Ai,Ts] = preparets(net,{},{},T); %
net = closeloop(train(net,Xs,Ts,Xi,Ai));
Ypred = nan(23,1);
% tre=Ypred;
Ypred = tonndata(Ypred,false,false);
Ypred(1:4) = T(end-3:end);
[xc,xic,aic,tc] = preparets(net,{},{},Ypred);
Ypred = fromnndata(net(xc,xic,aic),true,false,false);
save('netAPB_Autumn')
% Performance= perform(net,tc,Ypred)
xlswrite('APB Predicted Result.xlsx', Ypred, 'a2:a20')
xd=1:1:20;
figure, plot(xd,Ypred,'--*', xd,Xtest, '-.o')
xlabel('Days')
ylabel('Prediction')
legend('Predicted', 'Actual')

0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Verification, Validation, and Test finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!