Evaluation model: Analytic hierarchy process

1. Model establishment

1.1 Establish a hierarchical structure model

  On the basis of in-depth analysis of practical problems, the relevant factors are decomposed into several levels from top to bottom according to different attributes. Factors on the same level are subordinate to or have an impact on the factors on the upper level, and at the same time dominate the next level. The factors at the upper level may be affected by the factors at the lower level. The top layer is the target layer, usually with only one factor. The bottom layer is usually the program or object layer. There can be one or several layers in the middle, usually the criterion or indicator layer. When there are too many criteria (usually 9), further steps should be taken. Decompose the sub-criteria layer.
  Use the analytic hierarchy process to sort college students’ choices after graduation:
Hierarchy diagram

1.2 Construct a judgment matrix

  The hierarchical structure reflects the relationship between factors, but each criterion in the criterion layer does not necessarily have the same proportion in the target measurement. Let xi x_ixiyi y_iyizzThe ratio of the influence of z isaij a_{ij}aij,则xi x_ixiyi y_iyizzThe ratio of the influence of z aji = 1 / aij a_{ji}=1/a_{ij}aji=1/aij
若矩阵 A = ( a i j ) m × n A=\left(a_{i j}\right)_{m\times n} A=(aij)m×n满足
( 1 )   a i j > 0 , ( 2 )   a j i = 1 a i j (1)\ a_{i j}>0, \quad (2)\ a_{j i}=\frac{1}{a_{i j}} (1) aij>0,(2) aji=aij1
It is called the direct and inverse matrix .
If matrix A also satisfies
aijajk = aik , ∀ i , j , k = 1 , 2 , ⋯ , n a_{ij} a_{jk}=a_{ik}, \forall i, j, k=1,2, \ cdots, naijajk=ai k,i,j,k=1,2,,n
is called a consistent matrix.
An n-th order direct and reciprocal matrix A is a consistent matrix if and only if its maximum characteristic rootλ max ⁡ = n \lambda_{\max }=nlmax=n , and when the positive reciprocal matrix A is non-uniform, there must beλ max ⁡ > n \lambda_{\max }>nlmax>n .
About how to determineaij a_{ij}aijFor values, it is recommended to quote numbers 1-9 and their reciprocals as scales. The following table lists the meaning of the 1-9 scale.
Insert image description here
The judgment matrix of the criterion layer is now constructed as follows:

Table 2 Judgment matrix at criterion level
A B1 B2 B3 B4 B5
B1 1 2 1/2 1 5
B2 1/2 1 1/4 1/2 2
B3 2 4 1 2 3
B4 1 2 1/2 1 4
B5 1/5 1/2 1/3 1/4 1

Then construct the judgment matrix of the solution layer as follows:

Table 3 Judgment matrix of scheme level

Insert image description here

1.3 Consistency test of judgment matrix

The steps for consistency testing of the judgment matrix are as follows:
(1) Calculate the consistency index CI.
CI = λ max ⁡ − nn − 1 CI=\frac{\lambda_{\max }-n}{n-1}CI=n1lmaxn
(2) Find the corresponding average random consistency index RI, for n = 1, 2, ⋯, 9 n=1,2, \cdots, 9n=1,2,,9 , the corresponding RI value is as follows
Insert image description here
(3) Calculate the consistency ratio CR.
CR = CIRICR=\frac{CI}{RI}CR=RICI
When CR < 0.10, the consistency of the judgment matrix is ​​considered acceptable, otherwise the judgment matrix should be appropriately modified.

1.4 Overall ordering of levels and consistency test

  First determine the weight vector ω 0 \omega_{0} of the criterion layer for the target layeroh0, since the number of target layers is one, the weight vector of the criterion layer for the target layer is also one. First find the eigenvector corresponding to the maximum eigenvalue of the judgment matrix of the criterion layer, and then standardize this eigenvector so that the values ​​are distributed between 0 and 1. The result is the weight vector of the criterion layer for the target layer; then determine The weight vector of the solution layer to the criterion layer ω 1 \omega_{1}oh1, since the criterion layer has 5 indicators, the scheme layer also has 5 weight vectors for the criterion layer. The same method can be used to determine the 5 weight vectors of the scheme layer for the criterion layer ω 11 , ω 12 , ω 13 , ω 14 , ω 15 \omega_{11}, \omega_{12}, \omega_{13}, \omega_{14}, \omega_{15}oh11,oh12,oh13,oh14,oh15,即ω 1 = [ ω 11 , ω 12 , ω 13 , ω 14 , ω 15 ] \omega_{1}=[\omega_{11}, \omega_{12}, \omega_{13}, \omega_{14 }, \omega_{15}]oh1=[ oh11,oh12,oh13,oh14,oh15] ; Finally, using the weighted average of the weight vector of the plan layer for the criterion layer and the weight vector of the criterion layer for the target layer, the scores of the four plans in the plan layer can be obtained.
  The total ordering of the hierarchy also needs to be tested for consistency. The random consistency ratio of the total ordering is
CR = ∑ j = 1 m CI ( j ) ω 0 ( j ) ∑ j = 1 m RI ( j ) ω 0 ( j ), j = 1 , ⋯ m CR=\frac{\sum_{j=1}^{m} CI(j) \omega_{0}(j)}{\sum_{j=1}^{m} RI(j) \omega_{0}(j)}, j=1, \cdots mCR=j=1mR I ( j ) ω0(j)j=1mC I ( j ) ω0(j),j=1,m
  where m is the number of criterion layers.

2. Model solution

Use Matlab programming to solve to obtain the weight vector ω 0 \omega_{0} of the criterion layer for the target layeroh0for

0.2320,0.1094,0.3721,0.2189,0.0675

The weight vector of the solution layer to the criterion layer ω 1 \omega_{1}oh1for

w1 = 4×5

0.4379    0.2437    0.3890    0.4385    0.3452

0.2437    0.2190    0.3609    0.1096    0.1850

0.0994    0.4379    0.1323    0.2652    0.0997

0.2190    0.0994    0.1177    0.1866    0.3701

The consistency test result of each indicator at the criterion layer is
cr1 = 1×5

0.0076    0.0076    0.0727    0.0225    0.0038

are less than 0.1, it is considered that the consistency of the judgment matrix is ​​acceptable.
  The total hierarchical ranking scores are 0.3923, 0.2513, 0.1850, 0.1850, and the total ranking consistency test result is 0.0349<0.1. The total hierarchical ranking results are considered to have satisfactory consistency and the analysis results are accepted.
  The Matlab program is as follows:

clc,clear 
fid=fopen('ahp.txt','r'); 
n1=5;n2=4; 
a=[]; 
for i=1:n1 
 tmp=str2num(fgetl(fid));
 a=[a;tmp]; %读准则层判断矩阵
end 
for i=1:n1 
 str1=char(['b',int2str(i),'=[];']);
 str2=char(['b',int2str(i),'=[b',int2str(i),';tmp];']);
 eval(str1);
 for j=1:n2 
 tmp=str2num(fgetl(fid));
 eval(str2); %读方案层的判断矩阵
 end
 end 
ri=[0,0,0.58,0.90,1.12,1.24,1.32,1.41,1.45]; %一致性指标
[x,y]=eig(a) %求特征值
lamda=max(diag(y))
num=find(diag(y)==lamda)
w0=x(:,num)/sum(x(:,num))
cr0=(lamda-n1)/(n1-1)/ri(n1); 
for i=1:n1 
 [x,y]=eig(eval(char(['b',int2str(i)]))); 
 lamda=max(diag(y)); 
 num=find(diag(y)==lamda); %最大特征值
 w1(:,i)=x(:,num)/sum(x(:,num))%准则层权值 
 cr1(i)=(lamda-n2)/(n2-1)/ri(n2); %准则层一致性比例
end 
cr1, ts=w1*w0, cr=cr1*w0

Guess you like

Origin blog.csdn.net/m0_64087341/article/details/132874258