当前位置:网站首页>Matlab tips (27) grey prediction
Matlab tips (27) grey prediction
2022-07-06 22:39:00 【mozun2020】
MATLAB Tips (27) Grey prediction
Preface
MATLAB Learning about image processing is very friendly , You can start from scratch , There are many encapsulated functions that can be called directly for basic image processing , This series of articles is mainly to introduce some of you in MATLAB Some concept functions are commonly used in routine demonstration !
Color prediction model is through a small amount of 、 Incomplete information , A prediction method of establishing a mathematical model to make a prediction . It is based on the past and present development laws of objective things , With the help of scientific methods, describe and analyze the future development trend and situation , And form scientific assumptions and judgments .
It is a method to predict the system with uncertain factors . Grey prediction identifies the difference of development trend between system factors , That is, correlation analysis , And generate and process the original data to find the law of system change , Generate data sequences with strong regularity , Then the corresponding differential equation model is established , So as to predict the future development trend of things . The grey prediction model is constructed by a series of quantitative values reflecting the characteristics of the prediction object observed at the same time interval , Predict the characteristic quantity at a certain time in the future , Or the time to reach a characteristic quantity .
The example encountered when searching for data , Here to share ,MATLAB Version is MATLAB2015b.
One . MATLAB Simulation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function : Grey prediction program
% Environmental Science :Win7,Matlab2015b
%Modi: C.S
% Time :2022-06-27
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% I. Clear environment variables
clear all
clc
tic
%Matlab Grey prediction program :
%y=input(' Please input data ');
y=[29.8 30.11 41.05 70.12 77.79 77.79 104.82 65.22 82.7 100.79]
n=length(y);
yy=ones(n,1);
yy(1)=y(1);
for i=2:n
yy(i)=yy(i-1)+y(i)
end
B=ones(n-1,2);
for i=1:(n-1)
B(i,1)=-(yy(i)+yy(i+1))/2;
B(i,2)=1;
end
BT=B';
for j=1:(n-1)
YN(j)=y(j+1);
end
YN=YN';
A=inv(BT*B)*BT*YN;
a=A(1);
u=A(2);
t=u/a;
t_test=input(' Enter the number to be predicted ');
i=1:t_test+n;
yys(i+1)=(y(1)-t).*exp(-a.*i)+t;
yys(1)=y(1);
for j=n+t_test:-1:2
ys(j)=yys(j)-yys(j-1);
end
x=1:n;
xs=2:n+t_test;
yn=ys(2:n+t_test);
plot(x,y,'^r',xs,yn,'*-b');
det=0;
for i=2:n
det=det+abs(yn(i)-y(i));
end
det=det/(n-1);
disp([' The percent absolute error is :',num2str(det),'%']);
disp([' Predictive value for :',num2str(ys(n+1:n+t_test))]);
% Please input data [29.8 30.11 41.05 70.12 77.79 77.79 104.82 65.22 82.7 100.79]
toc
Two . Simulation results
y =
29.8000 30.1100 41.0500 70.1200 77.7900 77.7900 104.8200 65.2200 82.7000 100.7900
yy =
29.8000
59.9100
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
yy =
29.8000
59.9100
100.9600
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
yy =
29.8000
59.9100
100.9600
171.0800
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
yy =
29.8000
59.9100
100.9600
171.0800
248.8700
1.0000
1.0000
1.0000
1.0000
1.0000
yy =
29.8000
59.9100
100.9600
171.0800
248.8700
326.6600
1.0000
1.0000
1.0000
1.0000
yy =
29.8000
59.9100
100.9600
171.0800
248.8700
326.6600
431.4800
1.0000
1.0000
1.0000
yy =
29.8000
59.9100
100.9600
171.0800
248.8700
326.6600
431.4800
496.7000
1.0000
1.0000
yy =
29.8000
59.9100
100.9600
171.0800
248.8700
326.6600
431.4800
496.7000
579.4000
1.0000
yy =
29.8000
59.9100
100.9600
171.0800
248.8700
326.6600
431.4800
496.7000
579.4000
680.1900
Enter the number to be predicted 6
The percent absolute error is :14.5128%
Predictive value for :110.5718 120.8171 132.0116 144.2434 157.6086 172.2122
Time has passed 1.866326 second .

3、 ... and . Summary
Gray scale prediction in prediction application , Such as weather forecast 、 earthquake prediction 、 Pest forecast, etc , Domestic scholars have made many useful studies . Simply take a note of the example of gray prediction analysis , It may be used later . Learn one every day MATLAB Little knowledge , Let's learn and make progress together !
边栏推荐
- 使用云服务器搭建代理
- 2022-07-05 stonedb sub query processing parsing time analysis
- Extern keyword
- NPDP certification | how do product managers communicate across functions / teams?
- 0 basic learning C language - digital tube
- CocosCreator+TypeScripts自己写一个对象池
- qt quick项目offscreen模式下崩溃的问题处理
- 如何实现文字动画效果
- 第十九章 使用工作队列管理器(二)
- pytorch_YOLOX剪枝【附代码】
猜你喜欢

signed、unsigned关键字

Balanced Multimodal Learning via On-the-fly Gradient Modulation(CVPR2022 oral)

Adavit -- dynamic network with adaptive selection of computing structure

Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem

Financial professionals must read book series 6: equity investment (based on the outline and framework of the CFA exam)

MySQL ---- first acquaintance with MySQL

Self made j-flash burning tool -- QT calls jlinkarm DLL mode

新手程序员该不该背代码?

基于 QEMUv8 搭建 OP-TEE 开发环境

软考高级(信息系统项目管理师)高频考点:项目质量管理
随机推荐
pytorch_YOLOX剪枝【附代码】
Pit encountered by handwritten ABA
uniapp设置背景图效果demo(整理)
2022-07-05 使用tpcc对stonedb进行子查询测试
On the problems of born charge and non analytical correction in phonon and heat transport calculations
Aardio - 封装库时批量处理属性与回调函数的方法
View
MySQL----初识MySQL
void关键字
LeetCode 练习——剑指 Offer 26. 树的子结构
0 basic learning C language - interrupt
memcached
Is there any requirement for the value after the case keyword?
Classification, function and usage of MySQL constraints
QT信号和槽
The difference between enumeration and define macro
第十九章 使用工作队列管理器(二)
qt quick项目offscreen模式下崩溃的问题处理
HDU 5077 NAND (violent tabulation)
关于声子和热输运计算中BORN电荷和non-analytic修正的问题