3

R で lpSolve を使用しています。私のモデル (データ包絡分析) は MAC で正常に動作しますが、UNIX クラスターで実行しようとすると、多くのモデルが劣化していることがわかります。lp.control オプションは、両方のシステムで同じです。presolve オプションと anti.degen オプションをいじることで、縮退の数を減らすことはできましたが、なくすことはできませんでした。

ビルド済みの R パッケージ (ベンチマーク、ノンパラエフ) を使用して同じ線形計画法モデルを解くと、まったく同じ問題が発生することに注意してください。

UNIX クラスタで縮退エラーが発生する理由を知っている人はいますか?

乾杯、

ピーター

誰かが興味を持っている場合、コードは次のとおりです。基本的に、300 のエージェントごとに線形計画法モデルを作成し、この問題を解決します。私の MAC ではすべての問題が問題なく解決されていますが、クラスターでは問題の 90% が縮退していることがわかりました。

library(lpSolveAPI)
set.seed(198302)

##############Create data
x=matrix(rnorm(1200,5,3),300,4)
y1=x%*%c(.4,.2,.7,.8)+rnorm(300,4,.5)
y2=x%*%c(.5,.8,.2,.3)+rnorm(300,4,.5)
y=cbind(y1,y2)

##############Write DEA function
xref=x
yref=y

##Define dimensions
mx<-ncol(xref)
my<-ncol(yref)
nref<-nrow(xref)
nobs<-nrow(x)

##Define empty matrices for efficiency scores, lambdas and slacks
eff<-rep(0,nobs) 
lambda<-matrix(0,nobs,nref)
slacks<-matrix(0,nobs,mx)

##Start the model, noting that there will be as many constraints as there are inputs, outputs and one additional constraint on lambda.  And as many decision variables as there are producers (lambdas) + one (efficiency score)
deamodel<-make.lp(nrow=mx+my+1,ncol=nref+1)
    ## For each input and output set the row as a constraint
    for (h in 1:mx) set.row(deamodel, h, c(0, -xref[, h]))
    for (h in 1:my) set.row(deamodel, mx + h, c(0, yref[, h]))
    ##Set a single objective function
    set.objfn(deamodel, 1, 1)
    ##Set the type of constraints.  Inputs and outputs are all greater than, lambdas is equal to
    set.constr.type(deamodel, c(rep(">=", mx + my),"="))
    ##Set another row as a constraint on lambdas
    set.row(deamodel, (mx+my+1), c(0,rep(1,nref)))
    set.rhs(deamodel, 1, mx+my+1)

##In a loop create a lp model for each producer
for (k in 1:nobs){
    ##Set the right hand side equal to output of the individual producer 
    set.rhs(deamodel, c(rep(0,mx), y[k, ]), 1:(mx + my))
    ##Set first column equal to input of producer
    set.column(deamodel, 1, c(1,x[k,]), 0:mx)
    ##Set some presolve options
    lp.control(deamodel, presolve=c("rows", "columns","rowdominate","coldominate","bounds"))
    ##Solve the model
    a=solve(deamodel)
    if (a==0){
        eff[k]<-get.objective(deamodel)
        lambda[k,]<-get.variables(deamodel)[-1]
        slacks[k,]<-get.constraints(deamodel)[1:mx]}
    if (a!=0){
        eff[k]<-NA
        lambda[k,]<-NA
        slacks[k,]<-NA
    }}

eff
4

1 に答える 1