美文网首页
预测2021年考研人数

预测2021年考研人数

作者: 枫桥夜漂客 | 来源:发表于2019-09-29 21:32 被阅读0次

随着就业压力越来越多,社会对学历要求越来越高,考研成为了提升就业竞争能力的首选。以下为枫叶收集的考研信息,用最小二乘法算法进行预测。

基本思想:求出这样一些未知参数使得样本点和拟合线的总误差(距离)最小。


预测2021年考研人数
预测2021年考研人数
预测2021年考研人数

下表为我收集的1995年到2018年历年考研人数数据。


预测2021年考研人数

%基于最小二乘法预测

[Num,Txt,Raw]=xlsread('历年考研数据.xlsx');%导入数据

Y1=Num(:,2)';

year=1995:2021; %未来四年

b1=sum(((year(1:24)-1995)-mean(year(1:24)-1995)).*(Y1-mean(Y1)))/sum(((year(1:24)-1995)-mean((year(1:24)-1995))).^2);

a1=mean(Y1)-b1*mean((year(1:24)-1995));

YY1=a1+b1.*(year-1995); %预测报考人数

Y2=Num(1:end-2,4)';

b2=sum(((year(1:22)-1995)-mean(year(1:22)-1995)).*(Y2-mean(Y2)))/sum(((year(1:22)-1995)-mean((year(1:22)-1995))).^2);

a2=mean(Y2)-b2*mean(year(1:22)-1995);

YY2=a2+b2.*(year-1995); %预测报考人数

plot(year,YY1,'r-s')

hold on

plot(year,YY2,'b-h')

plot(year(1:24),Num(:,2),'g-d')%实际人数

plot(year(1,1:22),Y2,'m-p')

xlabel('年份')

ylabel('人数(万)')

legend('预测报考人数','实际报考人数','实际录取人数','预测录取人数')

set(gca,'XTick',1995:1:2021)

grid on

所得结果图

预测2021年考研人数

相关文章

网友评论

      本文标题:预测2021年考研人数

      本文链接:https://www.haomeiwen.com/subject/xvpqpctx.html