完整的灰色预测源程序,程序可以直接用
syms a b;
c=[a,b]';
A=[13.9,10.6,31.5,142.5];
B=cumsum(A);
n=length(A);
for i=1:(n-1)
C(i)=(B(i)+B(i+1))/2;
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
2021-11-01 16:13:18
371B
灰色预测
1