Learn R Programming

Benchmarking (version 0.10)

cost.opt: DEA Optimal Cost

Description

Estimate the optimal input and/or output for optimal/minimum/maximum cost, revenue or profit for a DEA technology set

Usage

cost.opt(XREF, YREF, W, YOBS=NULL, RTS="vrs", TRANSPOSE=FALSE, 
                     LP=FALSE, LPK = NULL)  

revenue.opt(XREF, YREF, P, XOBS = NULL, RTS = "vrs", TRANSPOSE = FALSE, 
              LP = FALSE, LPK = NULL)

profit.opt(XREF, YREF, W, P, RTS = "vrs", TRANSPOSE = FALSE, 
                 LP = FALSE, LPK = NULL)

Arguments

Input and output matrices are in the same form as for the method dea.
XREF
input determining technology where efficiency is to be calculated, a K x m matrix of observations of K firms with m inputs (firm x input). In case TRABSPOSE=TRUE the input matrix is transposed as input x firm.
YREF
output determinig technology where efficiency is to be calculated, a K x n matrix of observations of K firms with n outputs (firm x input). In case TRABSPOSE=TRUE the output matrix is transposed as output x firm.
W
input prices as a matrix. Either same prices for all firms or individual prices for all firms; i.e. etiher a 1 x m or K x m matrix for K firms and m inputs
P
output prices as a matrix. Either same prices for all firms or individual prices for all firms; i.e. etiher a 1 x n or K x n matrix for K firms and n outputs
XOBS
the input to where optimal output is to be calculated. Deaults to XREF. Same form as XREF
YOBS
the output to where optimal input is to be calculated. Deaults to YREF. Same form as YREF
RTS
A text string or a number to state the returns to scale assumption. Only numbers implementet as of this writing. rcl{ 0 "fdh" Free disposability hull, no convexity assumption 1 "vrs" Variable returns to scale, convex and fr
TRANSPOSE
Input and output matrices are treated as goods times units as defaults. If TRANSPOSE=FALSE then marices are units times goods as in standard in R for statistical models
LP
Only for debugging. If LP=TRUE then input and output for the LP program are written to standard output for each unit.
LPK
When LPK=k then a mps file is written for firm k; it can be used as input to an alternative LP solver just to check the our results.

Value

  • The values returned is the optimal input. When saved in an object the following is available:
  • xoptThe optimal input, returned as a matrix.
  • costThe optimal cost.
  • lambdaThe weights that determines the technology.

Details

The optimization is done by the R method in the package lpSolve. The methods print and summary is working for cost.opt

References

PB & LO

See Also

FEAR

Examples

Run this code
x <- matrix(c(2,12, 2,8, 5,5, 10,4, 10,6, 3,13), ncol=2, byrow=TRUE)
y <- matrix(1,nrow=dim(x)[1],ncol=1)
w <- matrix(c(1.5, 1),ncol=2)

txt <- LETTERS[1:dim(x)[1]]
dea.plot(x[,1],x[,2], ORIENTATION="in",  cex=1.25)
text(x[,1],x[,2],txt,adj=c(-.7,-.2),cex=1.25)

te <- dea(x,y,RTS="vrs")
xopt <- cost.opt(x,y,w,RTS=1)
cobs <- x %*% t(w)
copt <- xopt$x %*% t(w)
ce <- copt/cobs
ae <- ce/te$eff
data.frame("ce"=ce,"te"=te$eff,"ae"=ae)
cbind(ce,eff(te),ae)
print(cbind("ce"=c(ce),"te"=te$eff,"ae"=c(ae)),digits=2)

# isocost line in the technology plot
abline(a=copt[1]/w[2], b=-w[1]/w[2], lty="dashed")
abline(a=0, b=x[2,2]/x[2,1], lty="dotted")

Run the code above in your browser using DataLab