Forecast price of MATLAB Grey GM (forecast model)

Source: Internet
Author: User
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);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.