评价和预测模型:
评价模型:
- 加权平均(评分和权重难以估计)
(MATLAB单引号的功能 : ① 定义字符型变量,s='I''m a string'; ② 对变量进行转置,Smxn, S'→Snxm 的字符串--加权运算)
Rate=[0.3 0.3 0.2 0.2];
Data=[90 96 94 99;98 98 80 89;91 90 98 80]
Res=Rate*Data'
- 层次分析(分为目标层-准则层-备选层)
层次分析需要进行一致性检验:(一致性指标CI、一致性比例CR<0.1 即可、平均随机一致性指标RI)--防止规则矛盾
function ahpactor
A = [1/1 2/1 5/1 3/1
1/2 1/1 3/1 1/2
1/5 1/3 1/1 1/4
1/3 2/1 4/1 1/1];
[w, CR] = AHP(A);
% face
A1 = [1/1 1/2 3/1
2/1 1/1 5/1
1/3 1/5 1/1];
[w1, CR1] = AHP(A1);
% body
A2 = [1/1 1/3 2/1
3/1 1/1 5/1
1/2 1/5 1/1];
[w2, CR2] = AHP(A2);
% voice
A3 = [1/1 2/1 1/5
1/2 1/1 1/7
5/1 7/1 1/1];
[w3, CR3] = AHP(A3);
% acting
A4 = [1/1 2/1 1/3
1/2 1/1 1/5
3/1 5/1 1/1];
[w4, CR4] = AHP(A4);
CRs = [CR1 CR2 CR3 CR4]
P = [w1 w2 w3 w4] * w
% ------------------------------------------------------------------------
function [w, CR] = AHP(A)
% n= [ 1 2 3 4 5 6 7 8 9
RI = [ 0.00 0.00 0.58 0.90 1.12 1.24 1.32 1.41 1.45];
n = size(A,1);
[V, D] = eig(A);
[lamda, i] = max(diag(D));
CI=(lamda-n)/(n-1);
CR = CI/RI(n);
W = V(:,i);
w = W/sum(W);