当前位置:网站首页>2021-02-03美赛前MATLAB的学习笔记(灰色预测、线性规划)
2021-02-03美赛前MATLAB的学习笔记(灰色预测、线性规划)
2022-06-11 00:29:00 【萧易风船长】
上午和半个下午在补昨天的坑,今天等下有工作,看了看神经网络用于大的数据集,所以不看了,小波分析是在降噪方面的方法,也不用了,所以只看一下灰色预测。、
灰色预测
灰色预测是在灰色模型基础上的。灰色模型Grey Model,又称为灰色理论,通用于大量和少量数据的预测。
众多灰色系统中,以单序列一阶线性微分方程模型GM(1,1)模型最为常用。
GM(1,1)原理
设有原始数据
x ( 0 ) = ( x ( 0 ) ( 1 ) , x ( 0 ) ( 2 ) , . . . , x ( 0 ) ( n ) ) x^{(0)}=(x^{(0)}{(1)},x^{(0)}{(2)},...,x^{(0)}{(n)}) x(0)=(x(0)(1),x(0)(2),...,x(0)(n))
1.去除波动性,累加前t项得
x ( 1 ) ( t ) = ∑ i = 1 t x ( 0 ) ( i ) x^{(1)}(t)=\sum_{i=1}^tx^{(0)}(i) x(1)(t)=i=1∑tx(0)(i)
2.对 x ( 1 ) ( t ) x^{(1)}(t) x(1)(t)建立一阶线性微分方程
d x ( 1 ) d t + a x ( 1 ) = u \frac {dx^{(1)}} {dt}+ax^{(1)}=u dtdx(1)+ax(1)=u
a叫发展系数,u叫灰色作用量
然后通过构造均值生成矩阵(用 0.5 ( x ( 1 ) ( 1 ) + x ( 1 ) ( 2 ) ) 0.5(x^{(1)}(1)+x^{(1)}(2)) 0.5(x(1)(1)+x(1)(2))代入上式, 对应的y是 ( x ( 0 ) ( 2 ) (x^{(0)}(2) (x(0)(2)),以此构造线性方程组,通过最小二乘法求解
这是个简洁有效的方法
不说了直接贴代码吧根据
clear
syms a;
syms b;
c=[a b];
A=[89677,99215,109655,120333,135823,159878,182321,209407,246619,300670];
B=cumsum(A);
n=length(A);
for i=1:(n-1)
C(i)=0.5*B(i)+0.5*B(i+1);
end
D=A;
D(1)=[];//自动忽略空行
D=D'
E=[-C;ones(1,n-1)];
c=inv(E*E')*E*D;
c=c';
a=c(1);
b=c(2);
F=[];F(1)=A(1);
for i=2:(n+10)
F(i)=(A(1)-b/a)/exp(a*(i-1))+b/a;
end
G=[];
G(1)=A(1);
for i=2:(n+10)
G(i)=F(i)-F(i-1);
end
t1=1999:2008;
t2=1999:2018;
plot(t1,A,'o',t2,G)
cumsum
逐个累加,第i项是前i项和
线性规划
这个之前学过一点lingo 所以详见lingo
边栏推荐
- Web3 ecological decentralized financial platform sealem Finance
- Linux安装mysql数据库详解
- QGC地面站使用教程
- Leetcode 1605 find valid matrix given row and Column Sums
- Beijing Yanqing District high tech enterprise cultivation support standard, with a subsidy of 100000 yuan
- Application of object storage S3 in distributed file system
- Garbled code when the command parameter contains% in VisualStudio debugging
- Introduction to the application process of Beijing China Patent Award, with a subsidy of 1million yuan
- IRS application release 15: application security self test guide
- Conda安装Pytorch后numpy出现问题
猜你喜欢

The emperors of the Ming Dynasty

Current limiting and download interface request number control

Threejs: how to get the boundingbox of geometry?

Projet Visualisation et analyse des données sur les épidémies basées sur le Web crawler

Sealem Finance打造Web3去中心化金融平台基础设施

ROS parameter server

SAS主成分分析(求相关阵,特征值,单位特征向量,主成分表达式,贡献率和累计贡献率以及进行数据解释)

中间件_Redis_05_Redis的持久化
![[ROS introduction] cmakelist Txt and packages XML interpretation](/img/26/bae82a457fb83b2214d2f8c20955e2.jpg)
[ROS introduction] cmakelist Txt and packages XML interpretation

Docking of express bird system
随机推荐
Leetcode linked list queue stack problem
数字ic设计自学ing
Garbled code when the command parameter contains% in VisualStudio debugging
CSRF攻击
How much is the bonus of China Patent Award, with a subsidy of 1million yuan
1.2、ROS+PX4预备基础知识
About mobx
负数+0+正数
Detectron2 trains its own dataset and converts it to coco format
HandlerMethodArgumentResolver(参数解析器)的作用+使用小案例
Leetcode string problem
Threejs: pit encountered in drawing Bessel curve with two-point coordinates
Makefile:1860: recipe for target ‘cmake_ check_ build_ system‘ failed make: *** [cmake_check_build_syst
SAS判别分析(Bayes准则和proc discrim过程)
Yunna Qingyuan fixed assets management and barcode inventory system
SAS cluster analysis (system cluster, dynamic cluster fastclus, variable cluster varclus)
Lazy singleton mode
卡尔曼滤波(KF)、拓展卡尔曼滤波(EKF)推导
立个flag--重构promise
项目_基于网络爬虫的疫情数据可视化分析