参考文献
1.姜启源,数学模型,北京:高等教育出版社,1998 【2】2009年北京统计年鉴 附录问题二
%建立观测矩阵 X4=-x4;
X4=(X4-min(X4))/(max(X4)-min(X4)); A=[x1',x2',x3',-x4']
%建立相对偏差矩阵 X1=X1'; X2=X2'; X3=X3'; X4=X4';
K=[X1,X2,X3,X4]
%建立隶属度矩阵R R=zeros(4,5); for i=1:30
if X1(i,1)<=0.2
R(1,1)=R(1,1)+1; elseif X1(i,1)<=0.4 R(1,2)=R(1,2)+1; elseif X1(i,1)<0.6 R(1,3)=R(1,3)+1; elseif X1(i,1)<=0.8 R(1,4)=R(1,4)+1; elseif X1(i,1)<=1
R(1,5)=R(1,5)+1; end end
for i=1:30
if X2(i,1)<=0.2
R(2,1)=R(2,1)+1; elseif X2(i,1)<=0.4 R(2,2)=R(2,2)+1; elseif X2(i,1)<0.6 R(2,3)=R(2,3)+1; elseif X2(i,1)<=0.8
R(2,4)=R(2,4)+1; elseif X2(i,1)<=1
R(2,5)=R(2,5)+1; end end
for i=1:30
if X3(i,1)<=0.2
R(3,1)=R(3,1)+1; elseif X3(i,1)<=0.4 R(3,2)=R(3,2)+1; elseif X3(i,1)<0.6 R(3,3)=R(3,3)+1; elseif X3(i,1)<=0.8 R(3,4)=R(3,4)+1; elseif X3(i,1)<=1
R(3,5)=R(3,5)+1; end end
for i=1:30
if X4(i,1)<=0.2
R(4,1)=R(4,1)+1; elseif X4(i,1)<=0.4 R(4,2)=R(4,2)+1; elseif X4(i,1)<0.6 R(4,3)=R(4,3)+1; elseif X4(i,1)<=0.8 R(4,4)=R(4,4)+1; elseif X4(i,1)<=1
R(4,5)=R(4,5)+1; end end R=R/30
%求出隶属度的归一化矩阵B for i=1:5
B(1,i)=(R(1,i)-min(R(1,:)))/(max(R(1,:))-min(R(1,:))); B(2,i)=(R(2,i)-min(R(2,:)))/(max(R(2,:))-min(R(2,:))); B(3,i)=(R(3,i)-min(R(3,:)))/(max(R(3,:))-min(R(3,:))); B(4,i)=(R(4,i)-min(R(4,:)))/(max(R(4,:))-min(R(4,:))); end B
%建立f矩阵 for i=1:4
c=0;
for j=1:5
c=c+(1+B(i,j)); end
for j=1:5
f(i,j)=(1+B(i,j))/c; end end f
%建立H(熵值)矩阵 for i=1:4 c=0;
for j=1:5
c=c+f(i,j)*log(f(i,j)); end
H(i)=(-1/log(5))*c; end H
%建立w(隶属度)矩阵 for i=1:4
w(i)=(1-H(i))/(4-(H(1)+H(2)+H(3)+H(4))); End
问题三 农业用水
Warnings during fitting:
Equation is badly conditioned. Remove repeated data points or try centering and scaling.
Linear model Poly4:
f(x) = p1*x^4 + p2*x^3 + p3*x^2 + p4*x + p5 Coefficients (with 95% confidence bounds):
p1 = 0.0001712 (-0.0002555, 0.0005979) p2 = -1.368 (-4.77, 2.035)
p3 = 4097 (-6076, 1.427e+004)
p4 = -5.455e+006 (-1.898e+007, 8.065e+006) p5 = 2.724e+009 (-4.014e+009, 9.462e+009)
Goodness of fit: SSE: 463.1
R-square: 0.5745
Adjusted R-square: 0.5064 RMSE: 4.304
工业用水
Warnings during fitting:
Equation is badly conditioned. Remove repeated data points or try centering and scaling.
Linear model Poly4:
f(x) = p1*x^4 + p2*x^3 + p3*x^2 + p4*x + p5 Coefficients (with 95% confidence bounds):
p1 = 0.0001322 (-1.224e-005, 0.0002765) p2 = -1.054 (-2.205, 0.09748) p3 = 3152 (-291.1, 6595)
p4 = -4.189e+006 (-8.765e+006, 3.864e+005) p5 = 2.088e+009 (-1.923e+008, 4.368e+009)
Goodness of fit: SSE: 53.04
R-square: 0.8214
Adjusted R-square: 0.7928 RMSE: 1.457
第三产业及生活用水 Warnings during fitting:
Equation is badly conditioned. Remove repeated data points or try centering and scaling.
Linear model Poly5:
f(x) = p1*x^5 + p2*x^4 + p3*x^3 + p4*x^2 + p5*x + p6 Coefficients (with 95% confidence bounds):
p1 = 6.532e-006 (-5.605e-006, 1.867e-005) p2 = -0.06497 (-0.1859, 0.056) p3 = 258.5 (-223.8, 740.8)
p4 = -5.141e+005 (-1.476e+006, 4.474e+005) p5 = 5.113e+008 (-4.47e+008, 1.47e+009) p6 = -2.034e+011 (-5.855e+011, 1.787e+011)
Goodness of fit: SSE: 19.8
R-square: 0.9591
Adjusted R-square: 0.9506 RMSE: 0.9082 用水总量
Warnings during fitting:
Equation is badly conditioned. Remove repeated data points or try centering and scaling.
Linear model Poly4:
f(x) = p1*x^4 + p2*x^3 + p3*x^2 + p4*x + p5 Coefficients (with 95% confidence bounds):
p1 = 0.0004458 (5.207e-005, 0.0008395) p2 = -3.557 (-6.697, -0.418) p3 = 1.065e+004 (1258, 2.003e+004)
p4 = -1.416e+007 (-2.664e+007, -1.683e+006) p5 = 7.062e+009 (8.445e+008, 1.328e+010)
Goodness of fit: SSE: 394.3
R-square: 0.5102
Adjusted R-square: 0.4318 RMSE: 3.971
水资源总量
Warnings during fitting:
Equation is badly conditioned. Remove repeated data points or try centering and scaling.
Linear model Poly5:
f(x) = p1*x^5 + p2*x^4 + p3*x^3 + p4*x^2 + p5*x + p6 Coefficients (with 95% confidence bounds):
p1 = 2.694e-005 (-8.362e-005, 0.0001375) p2 = -0.2679 (-1.37, 0.8341) p3 = 1065 (-3328, 5459)
p4 = -2.119e+006 (-1.088e+007, 6.64e+006) p5 = 2.107e+009 (-6.624e+009, 1.084e+010) p6 = -8.378e+011 (-4.318e+012, 2.643e+012)
Goodness of fit: SSE: 1643
R-square: 0.3654
Adjusted R-square: 0.2332 RMSE: 8.273