(精品)直觉模糊层次分析法matlab代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
编程
% 对第一层指标直觉偏好矩阵进行变换,计算其直觉模糊判断矩阵clc,clear
r1=[0.5 0.65 0.6;
0.25 0.5 0.55;
0.2 0.3 0.5];
r2=[0.5 0.25 0.2;
0.65 0.5 0.3;
0.6 0.55 0.5];
R1=r1;
R2=r2;
R1(1,3)=(r1(1,2)*r1(2,3))/((r1(1,2)*r1(2,3))+(1-r1(1,2))*(1-r1(2,3)));
R2(1,3)=(r2(1,2)*r2(2,3))/((r2(1,2)*r2(2,3))+(1-r2(1,2))*(1-r2(2,3)));
R1(3,1)=R2(1,3);
R2(3,1)=R1(1,3);
R0=ones(3);r0=ones(3);
C=abs(R1-r1)+abs(R2-r2)+abs((R0-R1-R2)-(r0-r1-r2));
d0=(1/(2*(3-1)*(3-2)))*sum(sum(C))
% d0=0.0942<0.1通过一致性检验
%--------------------------------------------------------------------------
% 对第二层指标直觉偏好矩阵进行变换,计算其直觉模糊判断矩阵r1=[0.5 0.25 0.2;
0.65 0.5 0.55;
0.6 0.23 0.5];
r2=[0.5 0.65 0.6;
0.25 0.5 0.3;
0.2 0.55 0.5];
R1=r1;
R2=r2;
R1(1,3)=(r1(1,2)*r1(2,3))/((r1(1,2)*r1(2,3))+(1-r1(1,2))*(1-r1(2,3)));
R2(1,3)=(r2(1,2)*r2(2,3))/((r2(1,2)*r2(2,3))+(1-r2(1,2))*(1-r2(2,3)));
R1(3,1)=R2(1,3);
R2(3,1)=R1(1,3);
R0=ones(3);r0=ones(3);
C=abs(R1-r1)+abs(R2-r2)+abs((R0-R1-R2)-(r0-r1-r2));
d1=(1/(2*(3-1)*(3-2)))*sum(sum(C))
% d0=0.1568>0.1未通过一致性检验
%--------------------------------------------------------------------------
% 设置参数进行调整
p=0.6;
R3=[];
for i=1:3
for j=1:3
R3(i,j)=(((r1(i,j))^(1-p))*((R1(i,j))^p))/(((r1(i,j))^(1-p))*((R1(i,j))^p)+(((1-r1(i,j))^(1-p)))*(((1-R1(i,j))^ p)));
R4(i,j)=(((r2(i,j))^(1-p))*((R2(i,j))^p))/(((r2(i,j))^(1-p))*((R2(i,j))^p)+(((1-r2(i,j))^(1-p)))*(((1-R2(i,j))^ p)));
end
end
R0=ones(3);r0=ones(3);
C=abs(R3-r1)+abs(R4-r2)+abs((R0-R3-R4)-(r0-r1-r2));
d2=(1/(2*(3-1)*(3-2)))*sum(sum(C))
% d1=0.0937<0.1通过一致性检验
%--------------------------------------------------------------------------
m=ones(3);
% 求得B的权重
bq1=[sum(R3(1,:))/sum(sum(m-R4)) 1-(sum(1-R3(1,:))/sum(sum(R4)))];
bq2=[sum(R3(2,:))/sum(sum(m-R4)) 1-(sum(1-R3(2,:))/sum(sum(R4)))];
bq3=[sum(R3(3,:))/sum(sum(m-R4)) 1-(sum(1-R3(3,:))/sum(sum(R4)))];
bq=[bq1;bq2;bq3]
%--------------------------------------------------------------------------
% 求C1的权重
wc1=ny_dc([0.3712,0.5997],[0.5476,0.3412]);
wc2=ny_dc(wc1,[0.1996,0.6626])
%--------------------------------------------------------------------------
% 对甲基金进行权重分析
W1=[0.4343,0.1677];
% 对乙基金进行权重分析
W2=[0.3990,0.1370];
%--------------------------------------------------------------------------
% 步骤六、绩效评价的排序
p1=0.5*(1+1-W1(1)-W1(2))*(1-W1(1))
p2=0.5*(1+1-W2(1)-W2(2))*(1-W2(1))
计算结果
d0 =
0.0942