Unlimited learning, half price | 50% off
Get 50% off unlimited learning

Benchmarking (version 0.10)

sfa: Stochastic frontier estimation

Description

Estimate a stochastic frontier production functin using a maximum likelihood method.

Usage

sfa(x, y, beta0 = NULL, lambda0 = 1, resfun = ebeta, 
    TRANSPOSE = FALSE, DEBUG=FALSE,..., control, hessian=2)

Arguments

x
input as a k x m matrix of observations on m inputs of k firms; (unit x input); MUST be a matrix. No constant for the intercept should be included in x as it is added by default.
y
output; k times 1 matrix (one output)
beta0
optional initial parameter values
lambda0
optional initial ratio of variances
resfun
function to calculate the residuals, default is a linear model with an intercept. Must be called as resfun(x,y,parm) where parm=c(beta,lambda) or parm=c(beta), and return the residuals as an array of length
TRANSPOSE
Data is transposed, ie. input is now m x k matrix
DEBUG
Set to TRUE to get various debuggen informatin written on the console
...
optional parameters for the ucminf method
control
list of control parameters to ucminf
hessian
how the Hessian is delivered, see the ucminf documentation

Value

  • The values returned is the same as for ucminf, i.e. a list with components plus some espicifically relevant for sfa:
  • parThe best set of parameters found c(beta,lambda).
  • valueThe value of minus loglikelihood function corresponding to 'par'.
  • betaThe parameters for the function
  • sigma2The estimate of the total variance
  • lambdaThe estimate of lambda
  • NThe number of observations
  • dfThe degrees of freedom for the model
  • residualsThe residuals as a n times 1 matrix/vector, can also be obtained by residuals(sfa-object)
  • fitted.valuesFitted values
  • vcovThe varians-covarians matrix for all estimaed parameters incl. lambda
  • convergenceAn integer code. '0' indicates successful convergence. Some of the error codes taken from ucminf are '1' Stopped by small gradient (grtol). '2' Stopped by small step (xtol). '3' Stopped by function evaluation limit (maxeval). '4' Stopped by zero step from line search More codes are found in ucminf
  • messageA character string giving any additional information returned by the optimizer, or 'NULL'.
  • oThe object returned by ucminf, for further information on this see ucminf

Details

The optimization is done by the R method ucminf. The efficiency terms are asumed to be half--normal distributed.

References

See the method ucminf for the possible optimization methods and further options

See Also

ucminf

Examples

Run this code
# Example from the book by Coelli et al.
# d <- read.csv("c:/0work/rpack/front41Data.csv", header = TRUE, sep = ",")
# x <- cbind(log(d$capital), log(d$labour))
# y <- matrix(log(d$output))

n <- 50
x1 <- 1:50 + rnorm(50,0,10)
x2 <- 100 + rnorm(50,0,10)
x <- cbind(x1,x2)
y <- 0.5 + 1.5*x1 + 2*x2 + rnorm(n,0,1) - pmax(0,rnorm(n,0,1))
sfa(x,y)
summary(sfa(x,y))


# Estimate efficiency for each unit
o <- sfa(x,y)
te <- te.sfa(o)
te1 <- te1.sfa(o)
te2 <- te2.sfa(o)
cbind(te,te1,te2)[1:10,]

# Detailed calculations with out the method te.sfa
e <- o$residuals    # Residuals
residuals(o)[1:10]        # or

sigma2.sfa(o)       # Estimated varians
lambda.sfa(o)       # Estimated lambda

Run the code above in your browser using DataLab