as_metafrontier_model: Convert a Fitted Frontier Model to Metafrontier Format

View source: R/model_extractors.R

as_metafrontier_modelR Documentation

Convert a Fitted Frontier Model to Metafrontier Format

Description

Generic function that extracts the components needed by metafrontier from a pre-fitted frontier model. Methods are provided for sfaR ("sfacross"), frontier ("frontier"), and Benchmarking ("Farrell") objects, as well as plain lists with the required fields.

Usage

as_metafrontier_model(x, ...)

Arguments

x

a fitted frontier model object.

...

additional arguments passed to methods.

Details

metafrontier(models = ...) calls this function internally on each supplied model, so fitted sfaR or frontier objects can be passed to metafrontier() directly. Manual conversion is only needed for hand-built list models. Converting an object that has already been converted is a no-op, so it is safe to pass converted objects to metafrontier() as well.

Note that Benchmarking::dea() ("Farrell") objects do not store the inputs, outputs, or frontier coefficients, so the converted model carries only efficiency scores and cannot be used with metafrontier(models = ...); use the formula interface with method = "dea" instead. Converting a Farrell object therefore raises a warning.

Value

A list of class "metafrontier_model" with components: beta, te, X, y, sigma_v, sigma_u, logLik, hessian, n, dist.

Examples

# Using a named list:
mod <- as_metafrontier_model(list(
  coefficients = c("(Intercept)" = 2, log_x1 = 0.5, log_x2 = 0.3),
  efficiency = runif(50, 0.7, 1),
  X = matrix(rnorm(150), 50, 3),
  y = rnorm(50, 5)
))
str(mod)


metafrontier documentation built on Aug. 19, 2026, 5:08 p.m.