armademo.asv
来自「时间序列预测算法。支持5种常见的算法 移动平均 非线性回归 指数平滑等」· ASV 代码 · 共 27 行
ASV
27 行
function armademo
% arma预测
% Parameter:
nseq = [0.93 2.04 2.94 3.84 4.83 5.68 6.77 7.90 8.85 9.87 10.71 11.54 1.07 2.21 3.16 4.41 5.23 6.16 7.37 8.58 9.62 1.07 1.29 1.19 1.16 1.17 1.15 1.38 1.41 1.25 1.26 1.08 1.03];
% Base the Input Predict Method to solve the nseq
nseq = nseq';
nseqdata = iddata(nseq(1:23));
m = armax(nseqdata,[1,3]);
yfilter = predict(m, nseq(24:33));
% Plot the orignal Graphic
x = 1:1:10; % 33个标本数据
y = nseq(24:33);
yar = yfilter{1};
plot(x,y, '--b*',x,yar, '--rs','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',2);
mse = MSE(nseq, yar);
disp( sprintf('The mean square error is: %f', mse ));
title('全社会客货运输量ARMA模型预测', 'FontSize', 10);
xlabel('月份', 'FontSize', 10);
ylabel('铁路客户量(亿)', 'FontSize', 10);
grid on
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?