Learning mathematical models [Ideal solution TOPSIS]

Evaluation methods can generally be divided into two categories, with the main difference being the method of determining weights. One type is the subjective weighting method, most of which use comprehensive consultation scores to determine the weight, such as the comprehensive index method, the fuzzy comprehensive evaluation method, the analytic hierarchy process, the efficacy coefficient method, etc. The other type is objective weighting, which determines the weight based on the correlation between indicators or the degree of variation of each indicator value, such as principal component analysis, factor analysis, ideal solution method (also called TOPSIS method), etc.

At present, there are dozens of comprehensive evaluation methods at home and abroad. Among them, the main evaluation methods are principal component analysis, factor analysis, TOPSIS rank sum ratio method, gray correlation method, weight method, analytic hierarchy process, fuzzy evaluation method, physical evaluation method, etc. Meta-analysis method, cluster analysis method, value engineering method, neural network method, etc.

ideal solution

Insert image description here

1.1 Methods and principles

Insert image description here
Insert image description here
The concept of using the ideal solution method to solve multi-attribute decision-making problems is simple. As long as an appropriate distance measure is defined in the attribute space, the distance between the alternative and the ideal solution can be calculated. The TOPSIS method uses the Euclidean distance. As for using both positive ideal solutions and negative ideal solutions, it is because when only using positive ideal solutions, sometimes there will be situations where the distance between certain two alternatives and the positive ideal solutions is the same. In order to distinguish the advantages and disadvantages of these two solutions, negative ideal solutions are introduced. Ideal solution and calculate the distance between these two solutions and the negative ideal solution. The solution with the same distance from the positive ideal solution and the one far away from the negative ideal solution is better.

1.2 Algorithmic steps of TOPSIS method

The following is a rough introduction to the steps, which is enough to better understand the process of the entire algorithm.
Insert image description here
Sometimes the forwarding step is omitted. In this case, when processing cost-type data later, it is necessary to obtain the minimum value.
After obtaining the data, cost data and interval data must be processed first.
In order to eliminate the influence of different indicator dimensions, the forwarded matrix needs to be standardized.
Insert image description here
Insert image description here
Another way of expressing it is as follows.
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Data preprocessing. Data preprocessing is also called attributes. Normalization of values ​​(not forward normalization, more like standardization)
When making decisions, it is generally necessary to normalize attribute values, which mainly has the following three functions:
(1) There are many types of attribute values, and the above three attributes are placed in It is not convenient to directly judge the merits of a scheme from the numerical value in the same table, so the data needs to be preprocessed so that the scheme with better performance under any attribute in the table will have a larger attribute value after transformation.
(2) Quantification. One of the difficulties in multi-attribute decision-making and evaluation is the incommensurability between attributes, that is, each column number in the attribute value table has a different unit (dimension). Even if different measurement units are used for the same attribute, the values ​​in the table will be different. When using various multi-attribute decision-making methods for analysis and evaluation, it is necessary to eliminate the impact of the selection of dimensions on the decision-making or evaluation results. This is non-dimensionalization.
(3) Normalization. The numerical values ​​of attribute values ​​of different indicators in the attribute value table are very different. In order to be intuitive and to facilitate the use of various multi-attribute decision-making and evaluation methods for evaluation, the values ​​in the attribute value table need to be normalized. Unification means transforming all the values ​​in the table into the interval [0, 1].

Common attribute normalization methods

Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Interval data or cost data must first be converted into benefit data using a conversion method, and then standardized. That is, first standardize and then standardize.
Vector normalization is not suitable for interval data.
For vector normalization, for the benefit type, just use the bij on the PPT.
For cost type bij*=1-bij
Insert image description here

example

Insert image description here
Insert image description here
First process the interval data teacher-student ratio

Insert image description here
Coding according to the transformation rule formula 12 of interval attributes

x2=@(qujian,lb,ub,x)(1-(qujian(1)-x)./(qujian(1)-lb)).*(x>=lb&x<qujian(1))+...
    (x>=qujian(1)&x<=qujian(2))+(1-(x-qujian(2))./(ub-qujian(2))).*...
    (x>qujian(2)&x<=ub);
%当在此区间时此区间为1,其他区间为0。此点乘其此作用
qujian=[5,6];lb=2;ub=12;%定义最优区间,最大最小值。
x2data=[5 6 7 10 2]';%x2的输入值
y2=x2(qujian,lb,ub,x2data)%输出数据

Insert image description here
The following is the overall code

a=[0.1 5 5000 4.7
   0.2 6 6000 5.6
   0.4 7 7000 6.7
   0.9 10 10000 2.3
   1.2 2 400 1.8];
[m,n]=size(a);
%第一步,对区间属性的数据进行预处理
x2=@(qujian,lb,ub,x)(1-(qujian(1)-x)./(qujian(1)-lb)).*(x>=lb&x<qujian(1))+...
(x>=qujian(1)&x<=qujian(2))+(1-(x-qujian(2))./(ub-qujian(2))).*...
(x>qujian(2)&x<=ub);%分段函数的表达
qujian=[5,6];lb=2;ub=12;
a(:,2)=x2(qujian,lb,ub,a(:,2))%对属性2进行变换
%第二步:设置权向量,并得到加权向量规范化矩阵
for j=1:n
    b(:,j)=a(:,j)/norm(a(:,j));%向量规范化。
end
w=[0.2 0.3 0.4 0.1];
c=b.*repmat(w,m,1);%求加权矩阵
%第三步求正理想解和负理想解
cstar=max(c);%求正理想解
cstar(4)=min(c(:,4))%属性4为成本型,正理想解成本型取最小值
c0=min(c);%求负理想解
c0(4)=max(c(:,4))%属性4为成本型的,负理想解成本型取最大值
% 第四步
for i=1:m
sstar(i)=norm(c(i,:)-cstar);%求到正理想解的距离
s0(i)=norm(c(i,:)-c0);%求到负理想解的距离
end
%第五步
f=s0./(sstar+s0);%求得分结果
[sf,ind]=sort(f,'descend') 
%"ascend"时,进行升序排序,为"descend"时,进行降序排序

Why are the results obtained after the first step
Insert image description here
so different from the code run separately above?
At this time, the data is only rounded when displayed. Click the a file in the workspace to get the results.
Insert image description here

Run the second step to get the result.
Insert image description here
Insert image description here
The result of the third step.
Positive ideal solution cstar. Negative
Insert image description here
ideal solution c0.
Insert image description here
Step 4.
The distance to the positive ideal solution sstar. The
Insert image description here
distance to the negative ideal solution s0.
Insert image description here
Step 5.
Find the score.
Insert image description here
The final result
is score and sort.
Insert image description here

Some code explanations

norm vector norm and matrix norm
Insert j picture description here
repmat repeat array copy. See help for details.
Insert image description here
Stack row vectors vertically four times.

Insert image description here
sort sorts array elements
[B,I] = sort(___) also returns a collection of index vectors for any of the above syntaxes. I has the same size as A and describes how the elements of A are arranged in B along the sorted dimensions. For example, if A is a vector, then B = A(I).
Insert image description here

Guess you like

Origin blog.csdn.net/Luohuasheng_/article/details/128531416