TOPSIS method
TOPSIS method
Technique for Order Preference by Similarity to ldeal Solution
Abbreviated as "prosperity-inferior solution distance method", it is mainly used to solve a certain type of "evaluation problems" in mathematical modeling. This type of problem usually gives specific data of various indicators and needs to be directly compared.
Code implementation in Malab:
%TOPSIS分析法 (“优劣解距离法”)
%这里默认各个评价指标的权重相同
%标准化处理
a=0;
a=input('请输入评价对象的数量:');
b=0;
b=input('请输入评价指标的数量:');
c=zeros(a,b);
c=input('请输入具体的评价数据:');
disp('标准化后的数据矩阵:');
d=c./repmat(sum(c.*c).^0.5,a,1);
disp(d);
%计算D+和D-
%
D_P=sum([(d-repmat(max(d),a,1)).^2],2).^0.5;
D_N=sum([(d-repmat(min(d),a,1)).^2],2).^0.5;
%再利用公式Si=(Di-)/(Di+)+(Di-)求出“为归一化后的得分”
Si=D_N./(D_N+D_P);
%再将得分归一化
S=Si./sum(Si);