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')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170355/image.png)
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Parametric Spectral Estimation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!