📄 regressdemo.asv
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -