萌说新语Matlab入门学习之VIKOR方法步骤与代码实现(
Matlab入门学习之
VIKOR方法步骤与代码实现(1)
VIKORmethodstepsandcodeimplementationofMatlabintroductorylearning(1)
分享兴趣,传播快乐,
增长见闻,留下美好!
亲爱的您,
这里是LearningYard学苑。
今天小编为大家带来的主题是VIKOR方法步骤与代码实现,
欢迎您的用心访问,
本期推文阅读时长大约5分钟,请您耐心阅读。
Shareinterest,spreadhappiness,
Increaseyourknowledgeandleavesomethingbeautiful!
Dearyou,
ThisisLearningYardAcademy。
ThetopicthattheeditorbringstoyoutodayisVIKORmethodstepsandcodeimplementation。
Welcomeyourvisit,
Thistweetusuallytakesabout5minutestoread,pleasereaditpatiently。
本次研究属性值为实数,属性权重已知的多属性决策问题,评价模型参考下表11进行构建,过程按以下步骤进行。建立的决策矩阵如表12所示,其中C1、C2、C3为效益型指标,C4为成本型指A2标。
Forthemultiattributedecisionmakingproblemwheretheattributevaluesarerealnumbersandtheattributeweightsareknowninthisstudy,theevaluationmodelisconstructedwithreferencetothefollowingtable11。Theprocessiscarriedoutaccordingtothefollowingsteps。TheestablisheddecisionmatrixisshowninTable12,whereC1,C2,andC3arebenefitbasedindicators,andC4iscostbasedindicatorA2。
表11
MATLAB中的代码表示为:
OriginMatrix。。。
〔22,75,22,50;。。。
28,66,17,55;。。。
14,90,11,43;。。。
34,80,15,48〕
OriginMatrix〔22,75,22,50;28,66,17,55;14,90,11,43;34,80,15,48〕
在操作中,需要先将矩阵行和列的元素个数求出来,以便未来修改了矩阵代码仍然能够不出错地运行。
SizeOriginMatrixsize(OriginMatrix);
OriginMatrixRowSizeOriginMatrix(1);
OriginMatrixColumnSizeOriginMatrix(2);
决策指标标准化
StandardizationofDecisionIndex
不同的决策变量量纲可能存在不同,为方便对各属性进行对比分析,需要将矩阵进行标准化处理,以消除量纲对最终结果的影响,使不同变量具有可比性。
决策指标包含效益型指标和成本型指标。效益型指标是正向化指标,数值越大表示决策者对该项越满意;成本型指标属于负向化指标,其数值越大决策者对该指标的满意度越低。针对不同的指标类型,需采用以下公式进行规范化处理。
令Xij为决策指标,Rij为指标标准化后的结果,则:
Differentdecisionvariablesmayhavedifferentdimensions。Inordertofacilitatecomparativeanalysisofvariousattributes,thematrixneedstobestandardizedtoeliminatetheinfluenceofdimensionsonthefinalresultandmakedifferentvariablescomparable。
Decisionmakingindicatorsincludebenefittypeindicatorsandcosttypeindicators。Thebenefitindexisapositiveindex。Thelargerthevalue,themoresatisfiedthedecisionmakeriswiththeitem;thecostindexbelongstothenegativeindex。Thelargerthevalue,thelowerthedecisionmaker’ssatisfactionwiththeindex。Fordifferentindicatortypes,thefollowingformulasneedtobeusedforstandardizedprocessing。
LetXijbethedecisionindexandRijbetheresultofthestandardizationoftheindex,then:
若Xij为效益型指标,
若Xij为成本型指标:
要注意,其中:
在脚本中,代码编写的思路为:先将包括成本型指标在内的所有指标按照公式
进行标准化处理,再针对性地对成本型指标按效益型指标公式进行标准化。因此,代码按下列方式进行编写。
StandardMatrixOriginMatrix;
fori〔1:OriginMatrixColumn〕
StandardMatrix(:,i)(OriginMatrix(:,i)min(OriginMatrix(:,i)))。。。
(max(OriginMatrix(:,i))min(OriginMatrix(:,i)));
end
fori4
StandardMatrix(:,i)(max(OriginMatrix(:,i))OriginMatrix(:,i))。。。
(max(OriginMatrix(:,i))min(OriginMatrix(:,i)));
end
display(StandardMatrix)
决策指标标准化结果为:
确定群体效用与个体遗憾
Determinegrouputilityandinpidualregret
设置标准化矩阵StandardMatrix中每列的最大和最小值:
计算群体效用值Si和个体遗憾值Ri:
录入权重的值:
Omega〔0。1,0。25,0。3,0。35〕
Omegaistheweight。
求出标准化矩阵中的最大值与最小值:
Bestvalue〔〕;
Worstvalue〔〕;
forj〔1:OriginMatrixColumn〕Bestvalue(end1)max(StandardMatrix(:,j));Worstvalue(end1)min(StandardMatrix(:,j));
end
这里需要在循环前建立空集,否则系统会提示找不到变量。
由于Si是由一个方案中所有属性值经计算后组合而成,所以我们可先单独求出s,再组合成Si,即:
sToken〔〕;
sarepartsofpopulationutilityvalue。
forj〔1:OriginMatrixColumn〕
fori〔1:OriginMatrixRow〕
sToken(end1)Omega(j)(Bestvalue(j)StandardMatrix(i,j))。。。。
(Bestvalue(j)Worstvalue(j));
end
end
s〔〕;
fori〔1:OriginMatrixRow〕
row〔sToken(i),sToken(iOriginMatrixColumn),。。。
sToken(i2OriginMatrixColumn),sToken(i3OriginMatrixColumn)〕;
s〔s;row〕;
end
display(s)
S〔〕;
Sispopulationutilityvalue。
fori〔1:OriginMatrixRow〕
S(end1)〔sum(s(i,:))〕;
end
display(S)
R〔〕;
Risinpidualregretvalue。
fori〔1:OriginMatrixRow〕
R(end1)〔max(s(i,:))〕;
end
display(R)