super efficiency dea error: Index exceeds matrix dimensions

7 ビュー (過去 30 日間)
Kerwin Liu
Kerwin Liu 2019 年 12 月 2 日
コメント済み: Kerwin Liu 2019 年 12 月 2 日
X=[];%input matrix
Y=[];%output matrix
n=size(X',1);
m=size(X,1);
s=size(Y,1);
epsilon=10^-10;
f=[zeros(1,n) -epsilon*ones(1,m+s) 1];
A=zeros(1,n+m+s+1);
b=0;
LB=zeros(n+m+s+1,1);
UB=[];
LB(n+m+s+1)=-Inf;
for i=1:n
Aeq=[[X(:,1:i-1),zeros(m,1),X(:,i+1:n)] eye(m) zeros(m,s) -X(:,i) [Y(:,1:i-1),zeros(s,1),Y(:,i+1:n)] zeros(s,m) -eye(s) zeros(s,1)]
beq=[zeros(m,1) Y(:,i)];
w(:,i)=linprog(f,A,b,Aeq,beq,LB,UB);
end
w
lambda=w(1:n,:);
s_minus=w(n+1:n+m,:);
s_plus=w(n+m+1:n+m+s,:);
theta=w(n+m+s+1,:);
I'm using the code above to solve a se-dea model with 38 DMUs, 11 input and 1 output. The code was found in a paper but it reports "Index exceeds matrix dimensions". I'm wondering why this happens and how to solve it. Thanks very much.

回答 (1 件)

Hiro Yoshino
Hiro Yoshino 2019 年 12 月 2 日
X=[];%input matrix
Y=[];%output matrix
Obviously the input dimensions for X, Y are zero, and thus
n=size(X',1);
m=size(X,1);
s=size(Y,1);
become zero. Am I taking it correctly?
why not using "break points" so you can check the line to know to what extent your code is OK?
This way you can check the code literally line by line.
  1 件のコメント
Kerwin Liu
Kerwin Liu 2019 年 12 月 2 日
Sorry but I was using
X=[];%input matrix
Y=[];%output matrix
simply because the X matrix is 11×38 and Y is 1×38 so I omit them to control the text length. I think the error occurs in the following line
for i=1:n
Aeq=[[X(:,1:i-1),zeros(m,1),X(:,i+1:n)] eye(m) zeros(m,s) -X(:,i) [Y(:,1:i-1),zeros(s,1),Y(:,i+1:n)] zeros(s,m) -eye(s) zeros(s,1)]
beq=[zeros(m,1) Y(:,i)];
w(:,i)=linprog(f,A,b,Aeq,beq,LB,UB);
end
as I checked the code by line

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by