资源预览内容
第1页 / 共9页
第2页 / 共9页
第3页 / 共9页
第4页 / 共9页
第5页 / 共9页
第6页 / 共9页
第7页 / 共9页
第8页 / 共9页
第9页 / 共9页
亲,该文档总共9页全部预览完了,如果喜欢就下载吧!
资源描述
clear; clc;A = 1 0 1 0 1 0 1 0 0;B = 0.5 0.2 0.3;m,n = size(A);C = zeros(m,n);for i = 1:n C(:,i) = A(:,i) -B(i);End变权 A=B=n,m=size(A)for i=1:mA(:,i)=A(:,i)/norm(A(:,i)endfor i=1:nC(i,:)=A(i,:).*Bend D=sum(C,2)for i=1:mF(:,i)=A(:,i)-Dend G=F+1for i=1:nH(i,:)=G(i,:).*Bend M=A.*HN=sum(M,2)关联系数法 (MATLAB代码)A=B=p=0.5n,m=size(A) for i=1:nD(i,:)=A(i,:).*Bend V0=sum(D,2)for i=1:n for j=1:m C(i,j)=abs(A(i,j)-V0(i) endendrmin=min(min(C) rmax=max(max(C) for i=1:n for j=1:m E(i,j)=(rmin+p*rmax)/(C(i,j)+p*rmax) endendn,m=size(A)for i=1:nR(i,:)=A(i,:).*BE(i,:)=R(i,:).*CendF=sum(E,2)for i=1:n for j=1:mU(i,j)=E(i,j)./F(i)endendG=A.*UH=sum(G,2)评价共识度n,m=size(L)for i=1:m for j=1:mY(i,j)=dot(L(:,i),L(:,j)/( norm(L(:,i)*norm(L(:,j)endendq=(sum(Y(:)-m)/(m*(m-1)for i=1:m X(i,:)=(sum(Y,2)-1)/ (m-1)endn,m=size(A)for i=1:nC(i,:)=A(i,:).*Bend D=sum(C,2)求矩阵方差n,m=size(A)for i=1:nC(i,:)=var(A(i,:)endW1=(1./(C+1)/(sum(1./(C+1)W=0.7*B+0.3.*W1n,m=size(A)for i=1:nC(i,:)= 0.6*B +0.4*A(i,:)endn,m=size(A)dot(A,B)/(norm(A)*norm(B)n,m=size(A)C=A.*BD=sum(C,2)for i=1:mF(:,i)=D-A(:,i)end G=F+1H=G.*B熵权法n,m=size(A)for i=1:mA(:,i)=A(:,i)/norm(A(:,i)endR=Arows,cols=size(R)for i=1:colsR(:,i)=R(:,i)/norm(R(:,i)endk=1/log(rows)f=zeros(rows,cols)sumBycols=sum(R,1)for i=1:rows for j=1:cols f(i,j)=R(i,j)/sumBycols(1,j)endendlnfij=zeros(rows,cols)for i=1:rows for j=1:cols if f(i,j)=0 lnfij(i,j)=0 else lnfij(i,j)=log(f(i,j)end endendhj=-k*(sum(f.*lnfij,1)weights=(1-hj)/sum(1-hj)相对熵n=length(x)f=zeros(1,n)for i=1:nf(i)=x(i).*log(x(i)./y(i)endg=sum(f,2)专家变权A=B=n,m=size(A)for i=1:nC(i,:)=A(i,:).*Bend D=sum(C,2)for i=1:mF(:,i)=abs(D-A(:,i)end G=max(F,2)for i=1:mH(:,i)=G-0.2*F(:,i)end for i=1:nI(i,:)=H(i,:).*Bend for i=1:nM(i,:)=F(i,:).*Bend N=G-0.2*sum(M,2)for i=1:mW(:,i)=I(:,i)./NendO=A.* WP=sum(O,2)n,m=size(A)C=A.*BD=sum(C,2)for i=1:mF(:,i)=abs(D-A(:,i)end G=max(F,2)for i=1:mH(:,i)=G-0.2*F(:,i)end I=H.*BM=F.*BN=G-0.2*sum(M,2)for i=1:mW(:,i)=I(:,i)./Nendm,n=size(A)for i=1:nfor j=1:mf(i)=x(i).*log(x(i)./y(i)m,n=size(A)for i=1:nA(:,i)=A(:,i)/norm(A(:,i)endrows,cols=size(R)maxR=max(R,1)for i=1:rowsfor j=1:cols R(i,j)=R(i,j)/maxR(j)endendfor i=1:rowsR(i,:)=R(i,:)/norm(R(i,:)end偏离权重n,m=size(A)for i=1:nC(i,:)=A(i,:).*Bend D=sum(C,2)for i=1:mF(:,i)=(D-A(:,i).2end E=sum(F,2)偏好距离求权重n,m=size(A)B=prod(A,2).(1/m)C=sum(B)D=B/Cfor i=1:mF(:,i)=(D-A(:,i).2endE=sum(F,1)W=(1./E)./(sum(1./E)群体一致度n,m=size(A)for i=1:mB=bsxfun(minus,A(:,i) , A(:,i)C=B.2D=1/2*(sum(sum(C).(1/2)endW=(1./D)/(sum(1./D)一致性检验A=x,y=eig(A)Jmax=max(max(y)n,m=size(A)RI=0 0 0.58 0.90 1.12 1.24 1.32 1.41 1.45 1.49 1.51CI=(Jmax-n)./(n-1)CR=CI./RI(1,n)自适应权重A=B=D1=R=0n,m=size(A)C=A.*BD=sum(C,2)D2=(sum(D-D1).2).(1/2)while(D20.001)for i=1:mF(:,i)=abs(D-A(:,i)end G=max(F,2)for i=1:mH(:,i)=G-0.2*F(:,i)end I=H.*BM=F.*BN=G-0.2*sum(M,2)for i=1:mW(:,i)=I(:,i)./NendB=WD1=DR=R+1C=A.*BD=sum(C,2)D2=(sum(D-D1).2).(1/2)End从评价的目标来看,用若干个指标或若干评价个体进行综合评价时,其对各被评价对象的作用并不是相同的,为了体现各评价指标或各评价个体在评价过程中的重要程度,在指标体系确定后,必须对各指标赋予不同的权重系数。
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号