Title: | Partial Frontier Efficiency Analysis |
---|---|
Description: | It calculates the alpha-quantile proposed by Daouia and Simar (2007) <doi:10.1016/j.jeconom.2006.07.002> and order-m efficiency score in multi-dimension proposed by Daouia and Gijbels (2011) <doi:10.1016/j.jeconom.2010.12.002> and computes several summaries and representation of the associated frontiers in 2d and 3d. |
Authors: | Thibault Laurent [aut, cre, cph], Abdelaati Daouia [aut] |
Maintainer: | Thibault Laurent <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.3.1 |
Built: | 2024-12-09 06:35:17 UTC |
Source: | CRAN |
It calculates the alpha-quantile efficiency score and order-m score in multi-dimension and gives representation of alpha-quantile efficiency frontier. This work was supported by the agence nationale de la recherche through the EPI project (ANR-08-BLAN-0106-01)
Package: | frontiles |
Type: | Package |
Version: | 1.2 |
Date: | 2023-04-01 |
License: | GPL Vesion 2 or later |
LazyLoad: | yes |
Abdelaati Daouia and Thibault Laurent
Maintainer: <[email protected]>
Daouia, A. and L. Simar (2007), Nonparametric efficiency analysis: A multivariate conditional quantile approach, Journal of Econometrics 140, 375-400.
data(spain) xobs=as.matrix(spain[,3:4]) yobs=as.matrix(spain[,1]) score.ref.1<-alphascore(xobs,yobs)
data(spain) xobs=as.matrix(spain[,3:4]) yobs=as.matrix(spain[,1]) score.ref.1<-alphascore(xobs,yobs)
Representation of the alpha-quantile efficiency frontier (output, input or hyperbolic direction) for a set of reference points (xobs, yobs) in 2D (1 output and 1 input).
alphafrontier.2d(xobs, yobs, type="output", alpha=0.95, add=FALSE, confidence=FALSE, shade=FALSE,...)
alphafrontier.2d(xobs, yobs, type="output", alpha=0.95, add=FALSE, confidence=FALSE, shade=FALSE,...)
xobs |
a matrix of size |
yobs |
a matrix of size |
type |
a direction to choose among "output", "input" and "hyper" |
alpha |
a scalar between 0 and 1 |
add |
a boolean with TRUE for keeping the active device |
confidence |
a boolean for representing a confidence interval |
shade |
a boolean for shading the confidence interval |
... |
usual options for ploting the frontier, lty, col, etc. |
Actually, there is no confidence interval when type="hyper". If type="input" and confidence=TRUE, the y-axis is permuted with the x-axis
No return value, used for plotting the alpha-quantile efficiency frontier for 1 output and 1 input
Abdelaati Daouia and Thibault Laurent
Daouia, A. and L. Simar (2007), Nonparametric efficiency analysis: A multivariate conditional quantile approach, Journal of Econometrics 140, 375-400.
# 1st example data(spain) plot(y ~ x2, data = spain) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", alpha = 0.95, col = 'red', lty = 2, add = TRUE) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "input", alpha = 0.95, col = 'royalblue', lty = 3, add = TRUE) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "hyper", alpha = 0.95, col = 'green', lty = 4, add = TRUE) legend("topleft", title = "alpha-quantile frontier; alpha=0.95", legend = c("output direction", "input direction", "hyper direction"), lty = 2:4, col = c("red", "royalblue", "green")) # 2nd example plot(y ~ x2, data = spain) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", alpha = 1, add = TRUE) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", alpha = 0.95, col = 'blue', lty = 2, add = TRUE) ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", m = 30, col = 'green', lty = 3, add = TRUE) legend("topleft", title = "output direction", legend = c("FDH", "alpha=0.95", "m=30"), lty = 1:3, col = c("black", "royalblue", "green")) # 3rd example alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", confidence = TRUE, shade = TRUE, alpha = 0.98) title("Alpha-quantile frontier with alpha=0.98 and its confidence interval")
# 1st example data(spain) plot(y ~ x2, data = spain) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", alpha = 0.95, col = 'red', lty = 2, add = TRUE) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "input", alpha = 0.95, col = 'royalblue', lty = 3, add = TRUE) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "hyper", alpha = 0.95, col = 'green', lty = 4, add = TRUE) legend("topleft", title = "alpha-quantile frontier; alpha=0.95", legend = c("output direction", "input direction", "hyper direction"), lty = 2:4, col = c("red", "royalblue", "green")) # 2nd example plot(y ~ x2, data = spain) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", alpha = 1, add = TRUE) alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", alpha = 0.95, col = 'blue', lty = 2, add = TRUE) ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", m = 30, col = 'green', lty = 3, add = TRUE) legend("topleft", title = "output direction", legend = c("FDH", "alpha=0.95", "m=30"), lty = 1:3, col = c("black", "royalblue", "green")) # 3rd example alphafrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", confidence = TRUE, shade = TRUE, alpha = 0.98) title("Alpha-quantile frontier with alpha=0.98 and its confidence interval")
3d representation of alpha-quantile frontier for a set of reference points (xobs,yobs) in the case of two input and one output. No representation yet for hyperbolic direction.
alphafrontier.3d(xobs, yobs, type="output",alpha=0.95, digits=4, box.leg=TRUE, palette=heat_hcl, rgl=FALSE, n.class=NULL, ...)
alphafrontier.3d(xobs, yobs, type="output",alpha=0.95, digits=4, box.leg=TRUE, palette=heat_hcl, rgl=FALSE, n.class=NULL, ...)
xobs |
a matrix of size |
yobs |
a matrix of size |
type |
a character, "output" or "input" direction |
alpha |
a scalar |
digits |
a precision parameter to compute the alpha-frontier |
box.leg |
representation of a legend-box on the plot with the values of frontier |
palette |
function to use for colors in case where option |
rgl |
a boolean, for output direction, representation of the graphic in 3d if TRUE |
n.class |
a numeric, for output direction, the number of class |
... |
usual parameters of function |
In "input" direction:
You choose a value of output in the legend box, the efficiency-frontier of the input is represented with the corresponding color on the 2d graphic.
In "output" direction :
For calculate the alpha-quantile efficiency output frontier everywhere, we have
constructed a grid of size by drawing vertical and horizontal lines
which intersect each reference observations. Then, we have calculated for each cell
the prediction of the alpha-quantile output
efficiency frontier which correspond to the
elements of the suite
where reference observations j,
verify
and
.
We propose to use an algorithm which filled up cells with colors depending on the values
taken by the alpha-quantile output efficiency frontier. The algorithm attach the row
and vary the column as the folling figure can show it.
no values
The algorithm used is certainly not optimized. For a data set of 61 observations, the function necessits 15.17s on an Optiplex GX745 2 duo 2.13GHz under Windows Vista and probably bugs beyond a certain number of observation
Abdelaati Daouia and Thibault Laurent
data(spain) xyn <- cbind(spain[, 3:4],spain[, 1]) xtab <- as.matrix(xyn[, c(1,2)]) ytab <- matrix(xyn[, 3]) # representation in 2-d op <- par(no.readonly = TRUE) # the whole list of settable par's. alphafrontier.3d(xtab, ytab, type = "output", alpha = 0.6, xlab = "input 1", ylab = "input 2", main = "blabla") points(xtab, pch = 16) par(op)
data(spain) xyn <- cbind(spain[, 3:4],spain[, 1]) xtab <- as.matrix(xyn[, c(1,2)]) ytab <- matrix(xyn[, 3]) # representation in 2-d op <- par(no.readonly = TRUE) # the whole list of settable par's. alphafrontier.3d(xtab, ytab, type = "output", alpha = 0.6, xlab = "input 1", ylab = "input 2", main = "blabla") points(xtab, pch = 16) par(op)
Calculates alpha-quantile efficiency score (output, input and hyperbolic direction) for a set of evaluation points (xeval, yeval) depending on reference points (xobs, yobs).
alphascore(xobs, yobs, xeval=xobs, yeval=yobs, alpha=0.95)
alphascore(xobs, yobs, xeval=xobs, yeval=yobs, alpha=0.95)
xobs |
a matrix of size |
yobs |
a matrix of size |
xeval |
a matrix of size |
yeval |
a matrix of size |
alpha |
a scalar |
A score between 0 and 1 means that DMU is inefficient. If DMU greater than 1, DMU is super-efficient.
a data.frame
object with the alpha-quantile efficiency score in:
output |
output direction |
input |
input direction |
hyper |
hyperbolic direction |
Abdelaati Daouia and Thibault Laurent
Daouia, A. and L. Simar (2007), Nonparametric efficiency analysis: A multivariate conditional quantile approach, Journal of Econometrics 140, 375-400.
# 1st example data(spain) res.alqf <- alphascore(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1]), alpha = 0.8) # 2nd example data(burposte) bur.samp <- burposte[which(burposte$xinput < 50000), ] ind.samp <- sample(nrow(bur.samp), 500) xeval <- as.matrix(bur.samp[ind.samp[1:100], 2]) yeval <- as.matrix(bur.samp[ind.samp[1:100], 3]) xobs <- as.matrix(bur.samp[ind.samp[101:500], 2]) yobs <- as.matrix(bur.samp[ind.samp[101:500], 3]) alphafrontier.2d(xobs, yobs, alpha = 0.95) points(xeval, yeval, pch = 16, col = 'red') text(xeval, yeval, as.character(1:100), adj = 2, cex = 0.8) score.new.0.95 <- alphascore(xobs, yobs, xeval, yeval, alpha = 0.95)
# 1st example data(spain) res.alqf <- alphascore(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1]), alpha = 0.8) # 2nd example data(burposte) bur.samp <- burposte[which(burposte$xinput < 50000), ] ind.samp <- sample(nrow(bur.samp), 500) xeval <- as.matrix(bur.samp[ind.samp[1:100], 2]) yeval <- as.matrix(bur.samp[ind.samp[1:100], 3]) xobs <- as.matrix(bur.samp[ind.samp[101:500], 2]) yobs <- as.matrix(bur.samp[ind.samp[101:500], 3]) alphafrontier.2d(xobs, yobs, alpha = 0.95) points(xeval, yeval, pch = 16, col = 'red') text(xeval, yeval, as.character(1:100), adj = 2, cex = 0.8) score.new.0.95 <- alphascore(xobs, yobs, xeval, yeval, alpha = 0.95)
Burposte data
data(burposte)
data(burposte)
A data frame with 9521 observations on the following 3 variables.
ident
a numeric vector
xinput
a numeric vector
yprod
a numeric vector
Cazals C., Florens J.-P., Simar L. (2002), Nonparametric frontier estimation: a robust approach, Journal of Econometrics 106, 1-25.
data(burposte)
data(burposte)
Representation of the m-order efficiency score (output, input or hyperbolic direction) for a set of reference points (xobs, yobs) in 2D (1 output and 1 input).
ordermfrontier.2d(xobs, yobs, type = "output", m = 30, add = FALSE, confidence = FALSE, shade = FALSE,...)
ordermfrontier.2d(xobs, yobs, type = "output", m = 30, add = FALSE, confidence = FALSE, shade = FALSE,...)
xobs |
a matrix of size |
yobs |
a matrix of size |
type |
a direction to choose among "output", "input" and "hyper" |
m |
an integer |
add |
a boolean with TRUE for keeping the active device |
confidence |
a boolean for representing a confidence interval |
shade |
a boolean for shading the confidence interval |
... |
usual options for ploting the frontier, lty, col, etc. |
Actually, there is no confidence interval when type="hyper". If type="input" and confidence=TRUE, the y-axis is permuted with the x-axis
No return value, used for plotting the m-order efficiency frontier for 1 output and 1 input
Abdelaati Daouia and Thibault Laurent
Daouia, A. and L. Simar (2007), Nonparametric efficiency analysis: A multivariate conditional quantile approach, Journal of Econometrics 140, 375-400.
# 1st example data(spain) plot(y ~ x2, data = spain) ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", m = 30, col = 'red', lty = 2, add = TRUE) ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "input", m = 30, col = 'royalblue', lty = 3, add = TRUE) ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "hyper", m = 30, col = 'green', lty = 4, add = TRUE) legend("topleft", legend = c("output direction", "input direction", "hyper direction"), lty = 2:4, col = c("red", "royalblue", "green")) # 2nd example ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", confidence = TRUE, shade = TRUE, m = 30)
# 1st example data(spain) plot(y ~ x2, data = spain) ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", m = 30, col = 'red', lty = 2, add = TRUE) ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "input", m = 30, col = 'royalblue', lty = 3, add = TRUE) ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "hyper", m = 30, col = 'green', lty = 4, add = TRUE) legend("topleft", legend = c("output direction", "input direction", "hyper direction"), lty = 2:4, col = c("red", "royalblue", "green")) # 2nd example ordermfrontier.2d(as.matrix(spain$x2), as.matrix(spain$y), type = "output", confidence = TRUE, shade = TRUE, m = 30)
Calculates order-m efficiency score (output, input and hyperbolic direction) for a set of assessment points (xeval, yeval) depending on sample points (xobs, yobs), using the formulas of Daouia and Gijbels (2011).
ordermscore(xobs, yobs, xeval=xobs, yeval=yobs, m=30)
ordermscore(xobs, yobs, xeval=xobs, yeval=yobs, m=30)
xobs |
a matrix of size |
yobs |
a matrix of size |
xeval |
a matrix of size |
yeval |
a matrix of size |
m |
an integer |
A score between 0 and 1 means that DMU is inefficient. If DMU greater than 1, DMU is super-efficient. The asymptotic formula of the order-m score are given in Daouia and Gijbels (2011).
a data.frame
object with the order-m efficiency score in:
output |
output direction |
input |
input direction |
hyper |
hyperbolic direction |
Abdelaati Daouia and Thibault Laurent
Daouia and Gijbels (2011), Robustness and inference in nonparametric partial-frontier modeling, Journal of Econometrics.
# 1st example data(spain) score.orderm<-ordermscore(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1])) # 2nd example data(burposte) ind.samp <- sample(nrow(burposte), 500) xobs <- as.matrix(burposte[ind.samp[1:100], 2]) yobs <- as.matrix(burposte[ind.samp[1:100], 3]) xeval <- as.matrix(burposte[ind.samp[101:500],2]) yeval <- as.matrix(burposte[ind.samp[101:500], 3]) score.orderm.2 <- ordermscore(xobs, yobs, xeval, yeval)
# 1st example data(spain) score.orderm<-ordermscore(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1])) # 2nd example data(burposte) ind.samp <- sample(nrow(burposte), 500) xobs <- as.matrix(burposte[ind.samp[1:100], 2]) yobs <- as.matrix(burposte[ind.samp[1:100], 3]) xeval <- as.matrix(burposte[ind.samp[101:500],2]) yeval <- as.matrix(burposte[ind.samp[101:500], 3]) score.orderm.2 <- ordermscore(xobs, yobs, xeval, yeval)
Calculates order-m efficiency score (output, input and hyperbolic direction) for a set of assessment points (xeval, yeval) depending on sample points (xobs, yobs), using the initial algorithm of Cazals et al. (2002).
ordermscore.boot(xobs, yobs, xeval=xobs, yeval=yobs, m=30, B=200, m.move=FALSE)
ordermscore.boot(xobs, yobs, xeval=xobs, yeval=yobs, m=30, B=200, m.move=FALSE)
xobs |
a matrix of size |
yobs |
a matrix of size |
xeval |
a matrix of size |
yeval |
a matrix of size |
m |
an integer, the number of selected firms |
B |
an integer, the number of replication |
m.move |
a boolean, to choose different values of m |
This function computes the algorithm initially proposed by Cazals et al. (2002). If m.move=TRUE, different values of m are given as suggested by Daouia et al (2009).
a data.frame
object with the average mean order-m efficiency score and standard deviation associated:
output |
output direction |
output |
output direction |
input |
input direction |
input |
input direction |
hyper |
hyperbolic direction |
hyper |
hyperbolic direction |
Abdelaati Daouia and Thibault Laurent
Cazals et al. (2002), Nonparametric frontier estimation: a robust approach, Journal of Econometrics.
Daouia et al. (2009), Regularization of Nonparametric Frontier Estimators, TSE working paper.
# 1st example data(spain) score.orderm.b <- ordermscore.boot(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1])) system.time( ordermscore.boot(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1])) ) system.time( ordermscore(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1])) ) # 2nd example data(burposte) ind.samp <- sample(nrow(burposte), 500) xobs <- as.matrix(burposte[ind.samp[1:100], 2]) yobs <- as.matrix(burposte[ind.samp[1:100], 3]) xeval <- as.matrix(burposte[ind.samp[101:500], 2]) yeval <- as.matrix(burposte[ind.samp[101:500], 3]) score.orderm.2.b <- ordermscore.boot(xobs, yobs, xeval, yeval)
# 1st example data(spain) score.orderm.b <- ordermscore.boot(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1])) system.time( ordermscore.boot(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1])) ) system.time( ordermscore(xobs = as.matrix(spain[, c(2, 3, 4)]), yobs = as.matrix(spain[, 1])) ) # 2nd example data(burposte) ind.samp <- sample(nrow(burposte), 500) xobs <- as.matrix(burposte[ind.samp[1:100], 2]) yobs <- as.matrix(burposte[ind.samp[1:100], 3]) xeval <- as.matrix(burposte[ind.samp[101:500], 2]) yeval <- as.matrix(burposte[ind.samp[101:500], 3]) score.orderm.2.b <- ordermscore.boot(xobs, yobs, xeval, yeval)
Computes the percentage of firms super-efficient according to the parameter alpha for alpha-quantile score and m for m-order score in a given direction.
ROCscore(xobs, yobs, type="output")
ROCscore(xobs, yobs, type="output")
xobs |
a matrix of size |
yobs |
a matrix of size |
type |
a direction to choose among "output", "input" and "hyper" |
A firm is super-efficient if it score is greater than 1. By consulting this graph, we may choose the values of alpha and m which correspond to the desired degree of robustness, i.e. the percentage of high performers of the population we want to exclude in our more realistic benchmarking comparison (see p.78 of Daraio and Simar, 2010).
a data.frame
object with:
alpha |
different values of alpha |
f(alpha) |
the percentage of firms super-efficient |
m |
different values of m |
f(m) |
the percentage of firms super-efficient |
Abdelaati Daouia and Thibault Laurent
Daraio and Simar (2007),Advanced Robust and Nonparametric Methods in Efficiency Analysis, Springer.
# 1st example data(spain) res.roc <- ROCscore(xobs = as.matrix(spain[,c(2,3,4)]), yobs = as.matrix(spain[,1]), type = "output")
# 1st example data(spain) res.roc <- ROCscore(xobs = as.matrix(spain[,c(2,3,4)]), yobs = as.matrix(spain[,1]), type = "output")
Spain data
data(spain)
data(spain)
A data frame with 61 observations on the following 4 variables.
y
a numeric vector of output
x1
a numeric vector of input
x2
a numeric vector of input
x3
a numeric vector of input
data(spain)
data(spain)