Increasing Accuracy of Univariate NARNET Time series
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!