萌说新语Matlab入门学习之VIKOR方法步骤与代码实现(1)
Matlab入门学习之
VIKOR方法步骤与代码实现(1)
VIKOR method steps and code implementation of Matlab introductory learning (1)
分享兴趣,传播快乐,
增长见闻,留下美好!
亲爱的您,
这里是LearningYard学苑。
今天小编为大家带来的主题是VIKOR方法步骤与代码实现,
欢迎您的用心访问,
本期推文阅读时长大约5分钟,请您耐心阅读。
Share interest, spread happiness,
Increase your knowledge and leave something beautiful!
Dear you,
This is LearningYard Academy.
The topic that the editor brings to you today is VIKOR method steps and code implementation.
Welcome your visit,
This tweet usually takes about 5 minutes to read, please read it patiently.
本次研究属性值为实数,属性权重已知的多属性决策问题,评价模型参考下表1-1进行构建,过程按以下步骤进行。建立的决策矩阵如表1-2所示,其中 C1 、C2、C3为效益型指标,C4为成本型指A2标。
For the multi-attribute decision-making problem where the attribute values are real numbers and the attribute weights are known in this study, the evaluation model is constructed with reference to the following table 1-1. The process is carried out according to the following steps. The established decision matrix is shown in Table 1-2, where C1, C2, and C3 are benefit-based indicators, and C4 is cost-based indicator A2.
表1-1
MATLAB中的代码表示为:
Origin_Matrix=...
[22,75,22,50;...
28,66,17,55;...
14,90,11,43;...
34,80,15,48]
Origin_Matrix=[22,75,22,50;28,66,17,55;14,90,11,43;34,80,15,48]
在操作中,需要先将矩阵行和列的元素个数求出来,以便未来修改了矩阵代码仍然能够不出错地运行。
Size_Origin_Matrix=size(Origin_Matrix);
Origin_Matrix_Row=Size_Origin_Matrix(1);
Origin_Matrix_Column=Size_Origin_Matrix(2);
决策指标标准化
Standardization of Decision Index
不同的决策变量量纲可能存在不同,为方便对各属性进行对比分析,需要将矩阵进行标准化处理,以消除量纲对最终结果的影响,使不同变量具有可比性。
决策指标包含效益型指标和成本型指标。效益型指标是正向化指标,数值越大表示决策者对该项越满意;成本型指标属于负向化指标,其数值越大决策者对该指标的满意度越低。针对不同的指标类型,需采用以下公式进行规范化处理。
令Xij为决策指标,Rij为指标标准化后的结果,则:
Different decision variables may have different dimensions. In order to facilitate comparative analysis of various attributes, the matrix needs to be standardized to eliminate the influence of dimensions on the final result and make different variables comparable.
Decision-making indicators include benefit-type indicators and cost-type indicators. The benefit index is a positive index. The larger the value, the more satisfied the decision maker is with the item; the cost index belongs to the negative index. The larger the value, the lower the decision maker’s satisfaction with the index. For different indicator types, the following formulas need to be used for standardized processing.
Let Xij be the decision index and Rij be the result of the standardization of the index, then:
若Xij为效益型指标,
若Xij为成本型指标:
要注意,其中:
在脚本中,代码编写的思路为:先将包括成本型指标在内的所有指标按照公式
进行标准化处理,再针对性地对成本型指标按效益型指标公式进行标准化。因此,代码按下列方式进行编写。
Standard_Matrix=Origin_Matrix;
for i=[1:Origin_Matrix_Column]
Standard_Matrix(:,i)=(Origin_Matrix(:,i)-min(Origin_Matrix(:,i)))/...
(max(Origin_Matrix(:,i))-min(Origin_Matrix(:,i)));
end
for i=4
Standard_Matrix(:,i)=(max(Origin_Matrix(:,i))-Origin_Matrix(:,i))/...
(max(Origin_Matrix(:,i))-min(Origin_Matrix(:,i)));
end
display(Standard_Matrix)
决策指标标准化结果为:
确定群体效用与个体遗憾
Determine group utility and inpidual regret
设置标准化矩阵Standard-Matrix中每列的最大和最小值:
计算群体效用值Si和个体遗憾值Ri:
录入权重ω的值:
Omega=[0.1,0.25,0.3,0.35]
% Omega is the weight.
求出标准化矩阵中的最大值与最小值:
Best_value=[ ];
Worst_value=[ ];
for j=[1:Origin_Matrix_Column] Best_value(end+1)=max(Standard_Matrix(:,j)); Worst_value(end+1)=min(Standard_Matrix(:,j));
end
这里需要在循环前建立空集,否则系统会提示找不到变量。
由于Si是由一个方案中所有属性值经计算后组合而成,所以我们可先单独求出s,再组合成 Si,即:
s_Token=[ ];
% s are parts of population utility value.
for j=[1:Origin_Matrix_Column]
for i=[1:Origin_Matrix_Row]
s_Token(end+1)=Omega(j)*(Best_value(j)-Standard_Matrix(i,j))./...
(Best_value(j)-Worst_value(j));
end
end
s=[ ];
for i=[1:Origin_Matrix_Row]
row=[s_Token(i),s_Token(i+Origin_Matrix_Column),...
s_Token(i+2*Origin_Matrix_Column),s_Token(i+3*Origin_Matrix_Column)];
s=[s;row];
end
display(s)
S=[ ];
% S is population utility value.
for i=[1:Origin_Matrix_Row]
S(end+1)=[sum(s(i,:))];
end
display(S)
R=[ ];
% R is inpidual regret value.
for i=[1:Origin_Matrix_Row]
R(end+1)=[max(s(i,:))];
end
display(R)