在使用TOPSIS法进行综合评价时,需要先将原始矩阵正向化,也就是要将所有的指标类型统一转化为极大型指标。常见的指标类型除了极大型指标外,还有极小型指标、中间型指标、和区间型指标,一起来看看怎么将这些指标转化为极大型指标吧!
When TOPSIS method is used for comprehensive evaluation, the original matrix needs to be forward first, that is, all index types should be uniformly transformed into extremely large indexes. Common types of indicators in addition to very large indicators, there are very small indicators, intermediate indicators, and interval type indicators, let's see how to transform these indicators into very large indicators!
01极小型指标转换为极大型指标
例子:
For example:
代码实现:
Code implementation:
知识补充:
function为M文件的语句引导,其格式为:
Knowledge Supplement:
Function is a statement bootstrap for an M file with the format:
function[y1,y2,...]=fun(x1,x2,...)
fun为用户自定义的函数名,需要注意的是不能与MATLAB的库函数相同
且两个文件的保存目录要一致
定义函数:
Fun is a user-defined function name, but it is important to note that it cannot be the same as the MATLAB library function
And the two files should be saved in the same directory
Define the function:
调用fun函数:
Call the fun function:
执行结果:
Execution Result:
02中间型指标转换为极大型指标
中间型指标:指标值既不要太大也不要太小,取某特定值最好。
Intermediate: The index value is neither too large nor too small. A particular value is best.
那么正向化的公式如下:
Then the forward equation is as follows:
例子:水质量评估的PH值
For example: pH value for water quality assessment
化简后的结果尽量在0~1之间,并且越靠近于最优值越接近于1.
代码实现:
The simplified result should be between 0 and 1, and the closer it is to the optimal value, the closer it is to 1.
Code implementation:
03区间型指标转换为极大型指标
区间型指标:指标落在某个区间内最好
Interval type indicators: indicators fall in a certain interval is the best
那么正向化的公式如下:
Then the forward equation is as follows:
例子:人的体温(36°~37°最好)。
For example: Human body temperature (36°~37° is best).
代码实现:
Code implementation:
参考资料:CSDN、谷歌翻译
本文由LearningYard学苑原创,如有侵权请联系删除