Ha ha. I have come again, this time writing is still the math model of the game inside the code. Grey Prediction Model. The specific code is the following ... There's no more stuff.
Forecast in Guangzhou 10 years of price MATLAB program:
Clc,clear;
Syms a B;
C=[a b] ';
A=[6795,7455.6,8677.6,11534.9,14605.5,15472.1,18163.9,18757.1,19711.5,21163.5];
B=cumsum (A); % raw Data accumulation
N=length (A);
For I=1: (n-1)
C (i) = (B (i) +b (i+1))/2; % Generate additive matrix
End
% calculation of values for pending parameters
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);
% forecast subsequent data
F=[]; F (1) =a (1);
For i=2: (n+10)% only speculated after 10 data, can be modified from this
F (i) = (A (1)-b/a)/exp (A * (i-1)) +b/a;
End
G=[]; G (1) =a (1);
For i=2: (n+10)% only speculated after 10 data, can be modified from this
G (i) =f (i)-f (i-1); % get the predicted data
End
t1=2007:2016;
t2=2007:2019; % more than 10 sets of data
G
H=plot (t1,a, ' o ', t2,g, '-'); % raw data vs. predictive data
Set (H, ' linewidth ', 1.5);