regressdemo.asv
来自「时间序列预测算法。支持5种常见的算法 移动平均 非线性回归 指数平滑等」· ASV 代码 · 共 27 行
ASV
27 行
function regressdemo
% 非线性拟合预测
% 双曲线
% 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];
nx = [1: 33];
% Base the Input Predict Method to solve the nseq
coef = polyfit(nx,nseq,12);
yfilter = polyval(coef,nx);
% Plot the orignal Graphic
x = 1:1:10; % 33个标本数据
y = nseq;
plot(x,y, '--bs',x,yfilter, '--rs','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',2);
mse = MSE(nseq, yfilter);
disp( sprintf('The mean square error is: %f', mse ));
title('全社会客货运输量非线性回归模型预测', 'FontSize', 10);
xlabel('月份', 'FontSize', 10);
ylabel('铁路客户量(亿)', 'FontSize', 10);
grid on
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?