当前位置:网站首页>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
边栏推荐
- 如何下载网页照片
- 项目_基于网络爬虫的疫情数据可视化分析
- Detectron2 trains its own dataset and converts it to coco format
- [geometric vision] 4.2 piecewise linear transformation
- 如何使用自定义注解进行参数校验
- Leetcode permutation and combination problem backtracking
- QGC地面站使用教程
- PX4从放弃到精通(二十四):自定义机型
- SAS principal component analysis (finding correlation matrix, eigenvalue, unit eigenvector, principal component expression, contribution rate and cumulative contribution rate, and data interpretation)
- Introduction to the application process of China Patent Award, with a subsidy of 1million yuan
猜你喜欢

Px4 installation tutorial (VI) vertical fixed wing (tilting)

Classic questions: 01 backpack, complete backpack, multiple backpack, two-dimensional cost Backpack

Yunna PDA wireless fixed assets inventory management system

Current limiting and download interface request number control

Project_ Visual analysis of epidemic data based on Web Crawler

焱融看|混合云环境下,如何实现数据湖最优存储解决方案

Sealem finance builds Web3 decentralized financial platform infrastructure

Brief description of custom annotations

threejs:如何获得几何体的boundingBox?

SAS discriminant analysis (Bayes criterion and proc discrim process)
随机推荐
threejs:两点坐标绘制贝赛尔曲线遇到的坑
焱融看|混合云环境下,如何实现数据湖最优存储解决方案
Web3 ecological decentralized financial platform sealem Finance
Hooks' design philosophy
Project_ Visual analysis of epidemic data based on Web Crawler
条码固定资产管理系统的作用,固定资产条码化管理
Leetcode string problem
使用 CompletableFuture
1.2、ROS+PX4预备基础知识
SQL question brushing and sorting in leetcode of partial deduction
如何下载网页照片
PX4装机教程(六)垂起固定翼(倾转)
IRS application release 15: application security self test guide
hooks的设计哲学
多兴趣召回模型实践|得物技术
2022 recognition requirements for new technologies and new products (services) in Huairou District, Beijing
2.1 ros+px4 simulation - Fixed Point flight control
Hao expresses his opinions: what small good habits have you adhered to?
Is the SQL query result different from what you expected? Mostly "null" is making trouble
2.1、ROS+PX4仿真---定点飞行控制