Mathematical modeling | Entropy weight method | Brief principle + Matlab code implementation

1. Introduction to core principles

1.1 Entropy  \mathop e\nolimits_j\

[Measuring the degree of confusion of a certain indicator]

(1) In information theory: Entropy is a measure of uncertainty, which can determine the randomness and disorder of an event.

(2) The entropy value can determine the degree of dispersion of an indicator . The greater the degree of dispersion (chaos) of an indicator, the greater the impact of the indicator on the subject of comprehensive evaluation.

1.2 Coefficient of variation  \mathop g\nolimits_j\

\large \top g\nolimits_j = 1 - \top e\nolimits_j\

The relationship between entropy and coefficient of variation:

The greater the entropy value and the smaller the coefficient of variation, the more ordered the indicator is and the smaller the amount of information (the less important) the indicator is.  


2. Example modeling process

2.1 Example 

Requirement: Based on the scores of 10 students in 8 courses given in the table below, give the ranking of the scholarships for these 10 students. 

2.2 Modeling process 

(1) Data preprocessing [standardization]

Reasons for standardization:

  • The magnitude of different indicators may be different
  • In the evaluation system, there are positive indicators (the larger the value, the better) and negative indicators (the smaller the value, the better).
  • Variable definition :  Set as  the score of the \large \mathop x\nolimits_{​{\rm{i}}j} \j -th course of the i- th student (note: the scores in this example are all positive indicators)
  • Positive indicator normalization:

\large \mathop a\nolimits_{ij} = \frac{​{\mathop x\nolimits_{ij} - \min \left\{ {\mathop x\nolimits_{1j} , \cdots ,\mathop x\nolimits_{nj} } \right\}}}{​{\max \left\{ {\mathop x\nolimits_{1j} , \cdots ,\mathop x\nolimits_{nj} } \right\} - \min \left\{ {\mathop x\nolimits_{1j} , \cdots ,\mathop x\nolimits_{nj} } \right\}}}\

  • Negative indicator normalization:

\large \mathop a\nolimits_{ij} = \frac{​{\max \left\{ {\mathop x\nolimits_{1j} , \cdots ,\mathop x\nolimits_{nj} } \right\} - \mathop x\nolimits_{ij} }}{​{\max \left\{ {\mathop x\nolimits_{1j} , \cdots ,\mathop x\nolimits_{nj} } \right\} - \min \left\{ {\mathop x\nolimits_{1j} , \cdots ,\mathop x\nolimits_{nj} } \right\}}}\

【After standardization, \large\mathop a\nolimits_{ij}\in[0,1]\ 】 

(2) Determine the index entropy value and coefficient of variation

  • The proportion of each evaluation object in each indicator (equivalent to the probability of occurrence)\large {\mathop p\nolimits_{ij}}\

\large \mathop p\nolimits_{ij} = \frac{ {\mathop a\nolimits_{ij} }}{ {\sum\limits_{i = 1}^n {\mathop a\nolimits_{ij} } }}\

  • Calculate entropy \large\mathop e\nolimits_j\

\large \mathop e\nolimits_j = - \frac{ {\sum\limits_{i = 1}^n {\mathop p\nolimits_{ij}} \ln \left( {\mathop\nolimits_{ij}} \right)}}{{\ln(n)}}\

  •  Calculate coefficient of variation \large\mathop g\nolimits_j\

\large \top g\nolimits_j = 1 - \top e\nolimits_j\

(3) Determine the weight and comprehensive score

  • Calculate coefficient of variation weights \large\mathop w\nolimits_j\

(Calculate the weight of the jth subject)

The greater the coefficient of variation of the indicator, the greater the amount of information, and the greater the weight of the corresponding subject scores.

\large \mathop w\nolimits_j = \frac{ {\mathop g\nolimits_j }}{ {\sum\limits_{i = 1}^m {\mathop g\nolimits_j } }}\

  • Calculate overall score \large \mathop s\nolimits_i \

(Calculate the comprehensive score of the i-th student)

We weight and sum different subjects to get each person’s evaluation score. The bigger the score, the better.

Note : \large {\mathop p\nolimits_{ij}}\and \large\mathop w\nolimits_j\are all obtained based on original data and are completely objective.

\large \mathop s\nolimits_i = \sum\limits_j^m {\mathop w\nolimits_j \mathop p\nolimits_{ij} } \;


3. Matlab implementation 

3.1 Code

(1)Indicator standardization

%初始化一个对应大小的标准化矩阵
x2 = zeros(n,m);

for j=1:1:m
    for i = 1:1:n
        x2(i,j) = (x(i,j)-min(x(:,j)))/(max(x(:,j))-min(x(:,j)));
        if(x2(i,j)==0)
            x2(i,j)=0.001;% 求对数不能为0,故取个极小的数
        end
    end
end

 (2) Find entropy and coefficient of variation

%求每个评价对象在各个指标的比重
p=x2./sum(x2);%sum函数默认是求每一列的

%求熵值
e = -( sum(p .* log(p)) )/log(n);

%求变异系数
g = 1 - e;

(3) Calculate the weight and solve the comprehensive evaluation 

%计算权重
w = g ./ sum(g);

%计算每个评价对象的综合评价值
s_ = (p * w')';

%降序排序
[ss,rank] = sort(s_,'descend');%对评价值从大到小排序;descend表示降序

3.2 Result display

From the variable rank we can get the ranking of students’ comprehensive scores:

Ranking 1 2 3 4 5 6 7 8 9 10
student number 9 1 3 6 7 5 10 4 8 2

4. Summary 

There are many methods for evaluating categories: entropy weight method, AHP, TOPSIS...

The biggest difference between the entropy weight method and others: the entropy weight method pursues "complete fairness", that is, complete objectivity , and is an evaluation system established based on the data itself.

Disadvantages: Difficulty taking factors outside of the data into account

Guess you like

Origin blog.csdn.net/zzztutu/article/details/127008993