📄 vinformation.m
字号:
% the program is with the value of information in the decision analysis
% please input the possibility before test and the profit of every distribution situation etc.
% please input the investigation information matrix
input('the program is with the value of information')
m=input('Please input the decision set number=')
n=input('Please input the situation set number=')
P=input('Please input the possibility before test array P(n)=')
Y=input('Please input the profit matrix of every situation Y(m,n)=')
D=input('Please input the investigation information matrix D(n,n)=')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Step1
for i=1:m
sumtemp=0;
for j=1:n
sumtemp=sumtemp+Y(i,j)*P(j);
end
E_B(i)=sumtemp;
end
maxtemp1=E_B(1);
for i=1:m
if maxtemp1<E_B(i)
maxtemp1=E_B(i);
end
end
E_R=maxtemp1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Step2
for i=1:n
for j=1:n
P_X_Jiao_Z(i,j)=D(i,j)*P(j);
end
end
for i=1:n
sumtemp2=0;
for j=1:n
sumtemp2=sumtemp2+P_X_Jiao_Z(i,j);
end
P_Z(i)=sumtemp2;
end
for i=1:n
for j=1:n
P_X_Z(i,j)=P_X_Jiao_Z(i,j)/P_Z(i);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Step3 the following method has difficulty,so use the multiple computing of two matrices!
%for i=1:m
% sumtemp3=0;
% for j=1:n
% sumtemp3=sumtemp3+P_X_Z(i,j)*Y(i,j);
%end
%R(i,j)=sumtemp3;
%end
E_A_Z=P_X_Z*Y';
E_A_Z_R=E_A_Z';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Step4
input('Please input the plans choosed after the investigation');
for j=1:n
input('When the result investigated')
j
A(j)=input('You choose the plan:')
end
for j=1:n
R_star(j)=E_A_Z_R(A(j),j);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Step5
sumtemp5=0;
for j=1:n
sumtemp5=sumtemp5+P_Z(j)*R_star(j);
end
E_R_star=sumtemp5;
Add_profit=E_R_star-E_R;
input('The Add profit by investigation is:')
Add_profit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -