| metafrontier | R Documentation |
Estimates group-specific frontiers and a metafrontier that envelops all group technologies. Supports both SFA-based (parametric) and DEA-based (nonparametric) approaches, with deterministic (Battese, Rao, and O'Donnell, 2004) or stochastic (Huang, Huang, and Liu, 2014) metafrontier estimation.
metafrontier(
formula = NULL,
data = NULL,
group = NULL,
method = c("sfa", "dea"),
meta_type = c("deterministic", "stochastic"),
dist = c("hnormal", "tnormal", "exponential"),
orientation = c("output", "input"),
rts = c("crs", "vrs", "drs", "irs", "fdh"),
models = NULL,
panel = NULL,
panel_dist = c("bc92", "bc95"),
type = c("radial", "directional", "hyperbolic"),
direction = c("proportional", "output", "input"),
control = list(),
estimator = c("bc88", "jlms"),
objective = c("lp", "qp"),
engine = c("internal", "sfaR", "frontier", "Benchmarking"),
slack = FALSE,
...
)
formula |
an object of class |
data |
a data frame containing all variables in the formula
and the grouping variable. Ignored if |
group |
a character string naming the column in |
method |
character. The frontier estimation method for
group-specific models: |
meta_type |
character. The method for estimating the
metafrontier: |
dist |
character. Distribution of the one-sided inefficiency
term in SFA models. One of |
orientation |
character. For DEA: |
rts |
character. Returns to scale for DEA: |
models |
an optional named list of pre-fitted group-specific
frontier models (objects from sfaR or frontier, or
hand-built lists). Fitted model objects are converted
automatically via |
panel |
an optional list with components |
panel_dist |
character. Panel SFA model: |
type |
character. For DEA: |
direction |
direction vector for DDF. Either a character
preset ( |
control |
a named list of control parameters passed to
|
estimator |
character. Technical efficiency estimator for
SFA models: |
objective |
character. Identification criterion for the
deterministic metafrontier: |
engine |
character. Estimation backend for the group
frontiers: |
slack |
logical. For radial DEA, compute second-stage input
and output slacks (with the radial score held fixed) against
both the group and the pooled reference sets. Default
|
... |
additional arguments passed to the group-level estimation functions. |
The metafrontier framework decomposes efficiency relative to a global technology into two components:
TE^*_i = TE_i \times TGR_i
where TE_i is efficiency relative to the group frontier and
TGR_i is the technology gap ratio measuring how close the
group frontier is to the metafrontier.
The deterministic metafrontier is identified by one of the two
criteria proposed by Battese, Rao, and O'Donnell (2004), subject in
both cases to the constraint that the metafrontier envelops all
group frontiers: minimising the sum of absolute deviations, which
reduces to a linear programme because the envelope constraints
force every deviation to be non-negative (O'Donnell, Rao, and
Battese, 2008, Eqs. 23-25), or minimising the sum of squared
deviations, a convex quadratic programme. The LP
(objective = "lp", the default) is solved via
lpSolveAPI; the QP (objective = "qp") is solved
exactly via quadprog when available, with an adaptive-barrier
fallback via constrOptim().
The stochastic metafrontier (Huang, Huang, and Liu, 2014) replaces
this with a second-stage SFA, providing a distributional framework
for inference on the TGR.
Convergence and failure handling: estimation stops with an
error only when no usable estimate exists (for example, when both
the BFGS and Nelder-Mead optimisers fail for a group frontier).
When an optimiser stops at a non-zero convergence code, the fitted
object is returned with a warning and the code is recorded; use
check_convergence or summary() to verify all
estimation stages before interpreting technology gap ratios,
confidence intervals, or productivity decompositions. Infeasible
DEA programmes yield NA efficiency scores, accompanied by a
warning and counted by check_convergence.
Note on standard errors (stochastic metafrontier):
The stochastic metafrontier is a two-stage estimator. Stage 2 treats
the fitted group frontier values as data, so the reported standard
errors, confidence intervals, and variance-covariance matrix do not
account for estimation uncertainty from Stage 1 (the
generated-regressor problem; see Murphy and Topel, 1985). Use
vcov(fit, correction = "murphy-topel") or bootstrap-based
confidence intervals via boot_tgr for corrected
inference.
Note on frontier orientation (SFA path):
The SFA estimation path assumes a production frontier
(\varepsilon = v - u). Cost frontiers (\varepsilon = v + u)
are not currently supported via the SFA path. The DEA path supports
both orientation = "output" and orientation = "input".
An object of class "metafrontier" (with subclass
"metafrontier_sfa" or "metafrontier_dea"),
containing:
the matched function call
list of fitted group-specific models
estimated metafrontier parameters
list of group-specific coefficient vectors
technology gap ratios for each observation
group-specific technical efficiency
metafrontier technical efficiency (TE* = TE x TGR)
log-likelihoods of group models
number of observations per group and total
group labels
estimation method used
metafrontier type used
integer convergence code for the
metafrontier stage (0 = success; optim
codes for the stochastic metafrontier and the QP barrier
fallback; 0 for a successful LP or DEA solution). Each SFA
group model in group_models additionally carries its
own convergence code. Use
check_convergence to inspect all stages.
the estimation choices used for the fit
Battese, G.E., Rao, D.S.P. and O'Donnell, C.J. (2004). A metafrontier production function for estimation of technical efficiencies and technology gaps for firms operating under different technologies. Journal of Productivity Analysis, 21(1), 91–103. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1023/B:PROD.0000012454.06094.29")}
Huang, C.J., Huang, T.-H. and Liu, N.-H. (2014). A new approach to estimating the metafrontier production function based on a stochastic frontier framework. Journal of Productivity Analysis, 42(3), 241–254. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11123-014-0402-2")}
O'Donnell, C.J., Rao, D.S.P. and Battese, G.E. (2008). Metafrontier frameworks for the study of firm-level efficiencies and technology ratios. Empirical Economics, 34(2), 231–255. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s00181-007-0119-4")}
# Simulate metafrontier data
set.seed(42)
sim <- simulate_metafrontier(n_groups = 2, n_per_group = 100)
# Estimate deterministic SFA metafrontier (BRO 2004)
fit <- metafrontier(log_y ~ log_x1 + log_x2,
data = sim$data,
group = "group",
method = "sfa",
meta_type = "deterministic")
summary(fit)
# Technology gap ratios
tgr <- technology_gap_ratio(fit)
summary(tgr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.