Learn mathematical modeling algorithms and applications [Gray relational analysis and prediction model]

Main content:
The concept of one-gray prediction;
two-gray generated sequence;
three-gray correlation analysis;
five-gray prediction examples;
four-gray model GM;

The concept of gray forecasting

In 1982, Chinese scholar Professor Deng Julong published the first Chinese paper "Gray Control System", marking the birth of the gray system discipline. The scope of application of gray system theory has been extended to many scientific fields such as industry, agriculture, society, economy, energy, geology, petroleum, etc. It has successfully solved a large number of practical problems in production, life and scientific research, and achieved remarkable results.
The application categories of gray systems are roughly divided into the following aspects:
(1) Gray correlation analysis.
(2) Gray prediction: population prediction; catastrophe prediction...etc.
(3) Gray decision-making.
(4) Gray predictive control.
The gray system theory is a new theoretical tool for people to understand the objective system and transform the objective system.

1. The concept of gray prediction

Gray system, white system and black system

  • A white system refers to a system whose internal characteristics are completely known, that is, the system's information is completely sufficient.
  • A black system refers to a system whose internal information is unknown to the outside world and can only be observed and studied through its connection with the outside world.
  • Part of the information in the gray system is known, and other part of the information is unknown. There is an uncertain relationship between various factors in the system.

Gray prediction method

  • Gray prediction method is a method of predicting systems containing uncertain factors .
  • Gray prediction is to predict the system that contains both known information and uncertain information, that is, to predict the gray process that changes within a certain range and is related to time .
  • Gray prediction identifies the degree of dissimilarity in development trends between system factors, that is, performs correlation analysis, and generates and processes original data to find the rules of system changes, generates data sequences with strong regularities, and then establishes corresponding differentials . equation model to predict the future development trend of things.
  • The gray prediction method uses a series of quantitative values ​​observed at equal intervals that reflect the characteristics of the prediction object to construct a gray prediction model to predict the characteristic quantity at a certain moment in the future, or the time to reach a certain characteristic quantity.

Four Common Types of Gray Forecasting

  • Gray time series forecasting is to use the observed time series reflecting the characteristics of the predicted object to construct a gray forecasting model to predict the feature quantity at a certain moment in the future, or the time to reach a certain feature quantity.
  • Distortion prediction , that is, predicting the moment when outliers appear through the gray model, and predicting when outliers will appear in a specific time zone.
  • System prediction , by establishing a set of interrelated gray prediction models for system behavior characteristic indicators, predicts changes in the mutual coordination relationships among many variables in the system.
  • Topological prediction is to make a curve from the original data, find all the time points when the fixed value occurs on the curve according to the fixed value, and use the fixed value as the framework to form a time point sequence, and then build a model to predict the time points when the fixed value occurs.

2. Gray relational degree and advantage analysis

We often have to analyze the factors of the system, which of these factors are the main ones for the system, which ones are secondary, which ones need to be developed, which ones need to be suppressed, which ones are potential, and which ones are obvious. The key to system analysis is how to correlate among factors and how to quantify the degree of correlation.
For example, the population problem constitutes a system. Factors affecting population development and change include social aspects such as family planning, social security, and social lifestyles; economic aspects such as national income, social welfare, and social insurance; and medical aspects such as Medical conditions, medical level, etc. That is to say, population is a system of various factors that are interrelated and restrict each other. Breaking down these factors will help people to predict the future of population and control population.
In the past, the basic method of factor analysis mainly used methods such as regression analysis , but the method of regression analysis has many deficiencies , such as requiring a large amount of data, a large amount of calculation, and possible abnormal situations . In order to overcome the above problems, this section adopts the method of gray relational analysis to do system analysis.
The gray correlation degree must be the correlation degree between the analysis vector and the vector and between the matrix and the matrix. Since the correlation degree is calculated, the correlation degree between a certain sequence to be compared and the reference object (reference sequence) must be calculated.

Gray correlation

Insert image description here
Insert image description here
Insert image description here

case analysis

Insert image description here
Insert image description here
Insert image description here
There is an error in the above picture. The above formula is obtained based on formula 1.
ζ1(1) is obtained from the first data of the first sample, and ζ1(2) is obtained from the second data of the first sample.
Insert image description here

3. Gray generated sequence

Gray system theory believes that although the objective appearance is complex, it always has an overall function and therefore must contain some internal law. The gray system seeks the law of change by sorting out the original data. This is a way to seek the realistic laws of the data, which is the generation of gray sequences. All gray sequences can weaken their randomness and reveal their regularity through some kind of generation. Common methods of data generation include accumulation generation , accumulation generation , and weighted accumulation generation .

Cumulative generation

Insert image description here

Cumulative subtraction generation

Insert image description here

Weighted neighbor generation

Insert image description here

Accumulation generation calculation example

Insert image description here
Insert image description here
The general economic sequence is a non-negative sequence. Accumulation generation can convert any non-negative sequence, oscillating or non-oscillating, into non-decreasing or increasing. to discover the rules.
Insert image description here
Insert image description here

Accumulation generation calculation example

Insert image description here

4. Gray model GM(1,1)

Gray system theory defines gray derivatives and gray differential equations based on concepts such as correlation space and smooth discrete functions , and then uses discrete data sequences to establish a dynamic model in the form of differential equations . That is, the gray model uses discrete random numbers to be generated and turned into randomness to be displayed. By weakening and more regularly generating numbers, a model in the form of a differential equation is established, which facilitates the study and description of its change process.
G represents gray (grey), M represents model (model).
Insert image description here
Insert image description here
Insert image description here
Dividing B on the left can also mean finding B The pseudo-inverse of B does not require B to be invertible.
The following is the proof of the above formula
Insert image description here

GM(1,1) gray prediction steps

1. Data inspection and processing

Insert image description here
When doing mathematical modeling, the rank ratio test detects whether the data can be processed with gray prediction.

2. Establish GM (1, 1) model

Insert image description here

3. Test predicted values

Insert image description here

Gray prediction calculation example

Insert image description here
Insert image description here
Insert image description here
Insert image description here

Case: The impact of the SARS epidemic on certain economic indicators

Insert image description here
Insert image description here
Insert image description here
Insert image description here

Model analysis and assumptions

  • According to the historical statistical data available, it can be seen that under normal circumstances, the annual average better reflects the change pattern of relevant indicators, so that the forecast evaluation can be divided into two parts
  • Use gray theory to establish a gray differential equation model and predict the 2003 average from the average from 1997 to 2002.
  • By calculating the relationship between the monthly indicator value and the total annual value through historical data, we can predict the monthly indicator value in 2003 under normal circumstances, and then compare it with the actual value to estimate the actual impact of the SARS epidemic.
  • The following two assumptions are given:
    (1) It is assumed that the city’s statistical data are reliable and accurate;
    (2) It is assumed that during and after the SARS epidemic in the city, the changes in the data are only related to the impact of the SARS epidemic, regardless of The influence of other random factors

Establish gray prediction model GM(1,1)

Insert image description here
Insert image description here
Insert image description here

Solving the model

Insert image description here
Insert image description here
Insert image description here
code

han1=[83.0 79.8 78.1 85.1 86.6 88.2 90.3 86.7 93.3 92.5 90.9 96.9
101.7 85.1 87.8 91.6 93.4 94.5 97.4 99.5 104.2 102.3 101.0 123.5
92.2 114.0 93.3 101.0 103.5 105.2 109.5 109.2 109.6 111.2 121.7 131.3
105.0 125.7 106.6 116.0 117.6 118.0 121.7 118.7 120.2 127.8 121.8 121.9
139.3 129.5 122.5 124.5 135.7 130.8 138.7 133.7 136.8 138.9 129.6 133.7
137.5 135.3 133.0 133.4 142.8 141.6 142.9 147.3 159.6 162.1 153.5 155.9
163.2 159.7 158.4 145.2 124.0 144.1 157.0 162.6 171.8 180.7 173.5 176.5];
han1(end,:)=[];%相当于han1=han1(1:6,:),即把最后一行空出来;
m=size(han1,2);%把月份提取出来,12个月
x0=mean(han1,2);%返回x矩阵每行的平均值,其中的2代表返回行
x1=cumsum(x0);%一次累加
alpha=0.4;
n=length(x0);%长度,数据的维度,n=6
z1=alpha*x1(2:n)+(1-alpha)*x1(1:n-1)%q求邻域生成数
Y=x0(2:n);B=[-z1,ones(n-1,1)];
ab=B\Y%求出a,b。此处B\,为求B的伪逆
k=6;
x7hat=(x0(1)-ab(2)/ab(1))*(exp(-ab(1)*k)-exp(-ab(1)*(k-1)))%预测结果
z=m*x7hat%12乘均值得到一整年的预测结果
u=sum(han1)/sum(sum(han1))
%sum(han1)为对han1的列求和得到的是行向量,sum(行向量)直接对行向量求和。此式子结果表示预测的每个月所占一年的总量的比例
v=z*u%结果是每个月的预测值

Operation results
Insert image description here
Insert image description here
Insert image description here
Insert image description here
According to the city's statistical report, the actual retail sales of goods in April, May and June 2003 were 145.2, 124 and 14.41 billion yuan respectively. Prior to this, according to the estimates of the statistical department, the SARS epidemic had the most severe impact on the city's commodity retail industry in April, May, and June, and the loss in these three months was estimated to be about 6.2 billion yuan. Calculated from the prediction results of our model, the loss in the three months of April, May, and June was 6.03 billion yuan. This data is basically in line with the estimated value of experts. It basically returned to normal in August, which also shows the correctness and reliability of the model. Sex
is one of the industries most affected by the tourism industry. In the worst four months of April, May, June, and July, more than 1 million people were lost. According to the latest statistics, the average consumption per person is 1,002 US dollars, which is about $1 billion loss. About 1.6 million people will be lost in the whole year, which is about 1.6 billion US dollars. By the end of the year, it will basically return to normal.
Some industries in the comprehensive service industry will have a greater impact, such as air transportation, hotel catering, etc., but some industries will have little impact, such as telecommunications. Wait, on average, the impact is not too great. The loss of about 7 billion yuan in the four months of May, June, July, and August can be seen from the forecast results. Although there is no epidemic in the second half of the year, people have been worried that SARS will come back Therefore, there is still a certain impact on these industries, that is, the continuation of the impact of SARS. Although the model is established to evaluate and predict the development law of a certain economic index, it is also applicable to some data laws in other aspects. Evaluation and prediction problems, that is, the model has a wide range of applicability.

Guess you like

Origin blog.csdn.net/Luohuasheng_/article/details/128572135