当前位置:网站首页>Analytic hierarchy process
Analytic hierarchy process
2022-06-29 06:37:00 【-Small transparency-】
abbreviation AHP, One of the basic models .
It is mainly used to solve evaluation problems ( for example : Which option is the best 、 Which athlete or employee performed better ).
Evaluation questions can be used Scoring solve , Scoring is to fill in the following table

The same color and are 1, Express The weight of a factor .
Evaluation questions ( Determine the evaluation index 、 Form an evaluation system )
① evaluation The goal is What is it? ?
② What kinds of options are available to achieve this programme ?
③ evaluation Rules Or what the indicators are ?( According to what evaluation is good or bad )
General evaluation indicators can be based on Background material 、 common sense 、 Reference materials collected on the Internet Combine
Insect tribe --- FastSeek ( A search site ):
Search the worming tribe - Search fast one step FastSeek ! Insect tribe is the exclusive first product of the whole network ! Gather for you Google, Baidu , Bing and other domestic and foreign comprehensive search and academic , resources , Vertical search for professional knowledge, etc . Accurate search , Convenient interaction ! It is the first stop of your web search !https://search.chongbuluo.com/ Divide and rule is the most important thing , Compare two indicators , Finally, the weight is calculated according to the comparison results



Consistency check :
principle : Test whether there is too much difference between our judgment matrix and consistent matrix

After the conformance test is passed , How to calculate the weight ?

The result is the same no matter which column is used , Because the columns of the consistency matrix are proportional ( Judgment matrix may be inconsistent ) So if it is a judgment matrix, the normalization results of all columns should be calculated . after , Select the output weight of the method
Method 1 : Calculate the weight by arithmetic average ( It can be put in the paper )
Method 2 : The geometric average method

Method 3 : Calculate the weight by eigenvalue method ( Most used )


It is best to use all three algorithms in the competition , Then add the following paragraph to the paper :

Finally, fill the weight in the table , Calculate the score .
When calculating, you can use Excel Tabular calculation , You want to calculate by dragging , You need to lock the indicator weight in the formula ( For example, to lock B3, Write it directly in the formula :$B$3, that will do )
summary ( Analytic hierarchy process steps ):

2. Compare the importance of each element in the same level with respect to a criterion in the previous level , Construct pairwise comparison matrix ( Judgment matrix )

3. The relative weight of the compared element to the criterion is calculated from the judgment matrix , And conduct consistency inspection ( The weight can only be used after passing the test )
CR>0.1 when , Adjust to the consistency matrix ( Multiply the rows of the consistent matrix )
4. Calculate the composite weight of each layer element to the system target , And sort

Code implementation (MATLAB):
clear;clc
disp(' Please enter the judgment matrix A: ')
A = input(' Judgment matrix A=') % Input judgment matrix
%% Weight calculation
% Method 1: Calculate the weight by arithmetic average
% First step : Normalize the judgment matrix by column ( Each element is divided by the sum of its columns )
Sum_A = sum(A,1) % The matrix is summed in columns to form a row of vectors
n = size(A,1) % Row of square matrix ( Column ) Count
SUM_A = repmat(Sum_A,n,1) %repeat matrix Abbreviation , dimension 1 Table column , the Sum_A repeat n That's ok
Stand_A = A ./ SUM_A % Each element of a square matrix is divided by the sum of the columns
% The second step : Add the normalized columns ( Sum up by line )
sum(Stand_A,2)
% The third step : Divide each element of the added vector by n The weight vector can be obtained
disp(' The result of calculating the weight by arithmetic average method is :');
disp(sum(Stand_A,2) / n)
% Method 2: Calculate the weight by geometric average method
% First step : take A The elements of are multiplied by rows to get a new column vector
Prduct_A = prod(A,2) % prod Functions and sum Function similar to , For multiplication and addition, respectively ,dim=2 A table dimension is a row
% The second step : Open each component of the new vector n Power
Prduct_n_A = Prduct_A .^ (1/n)
% The third step : The weight vector can be obtained by normalizing the column vector
disp(' The result of weight calculation by geometric average method is :');
disp(Prduct_n_A ./ sum(Prduct_n_A)) % Divide each element in this column vector by the sum of this vector
% Method 3: Calculate the weight by eigenvalue method
% First step : Find the matrix A The maximum eigenvalue of and its corresponding eigenvector
[V,D] = eig(A) %V It's the eigenvector , D Is a diagonal matrix composed of eigenvalues
Max_eig = max(D(:))
[r,c] = find(D == Max_eig , 1) % Look for D The position of the first element equal to the maximum characteristic value in the records its row and column .
% The second step : We can get our weight by normalizing the obtained eigenvector
disp(' The result of calculating the weight by eigenvalue method is :');
disp( V(:,c) ./ sum(V(:,c)) )
%% Calculate the consistency ratio CR
CI = (Max_eig - n) / (n-1);
RI=[0 0 0.52 0.89 1.12 1.26 1.36 1.41 1.46 1.49 1.52 1.54 1.56 1.58 1.59];% notes :RI most n=15
CR=CI/RI(n);
disp(' Consistency indicators CI=');disp(CI);
disp(' Consistency ratio CR=');disp(CR);
if CR<0.10
disp(' because CR < 0.10, So the judgment matrix A The consistency of is acceptable !');
else
disp(' Be careful :CR >= 0.10, Therefore, the judgment matrix A Need to change !');
end边栏推荐
- How does MySQL implement distributed locks?
- Meta metauniverse female safety problems occur frequently. How to solve the relevant problems in the metauniverse?
- Unity AR Shadow 阴影
- Illustrate plug-in -- AI plug-in development -- creative plug-in -- astute graphics -- path width style function
- C language pointer to function
- VerilogA——动态比较器
- AIRNET notes 1
- Character pointer as function parameter
- Mongodb sort function
- [high concurrency] deeply analyze the callable interface
猜你喜欢

The simple problem of leetcode is to divide an array into three parts equal to sum

Print Yanghui triangle

关于 localStorage 的一些高阶用法

二叉树的迭代法前序遍历的两种方法

Yyds dry goods inventory meituan's two-sided experience, and finally there was a surprise?

Chapter V online logic analyzer signaltap

Test Development - ten years of sharpening one sword (VII) interface test tool postman

Are there too many programmers in China at present?

MySQL learning notes

Fault: KDC warning log for id29
随机推荐
Ribbon service invocation and load balancing
JDBC | Chapter 6: simple use of database connection pool
National Defense University project summary
Illustrate plug-in -- AI plug-in development -- creative plug-in -- astute graphics -- path width style function
Honeypot based on MySQL load data local INFILE
Browser local storage
AIRNET notes 1
Go basic data types: characters and strings
What is MES? What does it do?
Multithreading tool class completabilefuture
How to combine two byte arrays [repeat] - how to combine two byte arrays [duplicate]
Aging design guide for applets
百度小程序自动提交搜索
Presto-Trial
Mongodb sort function
Illustrate plug-in -- AI plug-in development -- creative plug-in -- astute graphics -- length and angle measurement function
Mongodb paging method
Pointer from beginner to advanced (2)
Monitor employee turnover dynamics. This system makes employees tremble!
Venn diagram proportional and color shading with semi transparency