综合评价
灰色关联
例
题目:分析下表中,哪一个产业对2000-2005年国内生产总值影响最大
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| >> data=xlsread('huiseguanlian-chanzhi.xlsx','B2:E7') data = 1988 386 839 763 2061 408 846 808 2335 422 960 953 2750 482 1258 1010 3356 511 1577 1268 3806 561 1893 1352 >> k=GRA(data) k = 0.5084 0.6243 0.7573 </code></pre> <pre><code class="language-matlab line-numbers">function correlationnew=GRA(data)
[m,n]=size(data); rou=0.5;
avedata=mean(data); for i=1:m newdata(i,:)=data(i,:)./avedata; end
for j=2:n diff(:,j-1)=abs(newdata(:,1)-newdata(:,j)); end
maxdiff=max(max(diff)); mindiff=min(min(diff));
for i=1:m for j=1:n-1 correlation(i,j)=(mindiff+rou*maxdiff)/(diff(i,j)+rou*maxdiff); end end correlationnew=mean(correlation);
|
由此我们可以知道第三产业对2000-2005年国内生产总值影响最大。
参考