check_convergence: Check Convergence of All Estimation Stages

View source: R/diagnostics.R

check_convergenceR Documentation

Check Convergence of All Estimation Stages

Description

Reports the convergence status of every estimation stage of a fitted metafrontier model: each group-level frontier and the metafrontier itself. This makes it easy to verify that all optimisers (MLE) and mathematical programmes (LP/QP) finished successfully before interpreting technology gap ratios, confidence intervals, or efficiency decompositions.

Usage

check_convergence(object, ...)

## S3 method for class 'metafrontier'
check_convergence(object, ...)

## S3 method for class 'lc_metafrontier'
check_convergence(object, ...)

## S3 method for class 'malmquist_meta'
check_convergence(object, ...)

Arguments

object

a fitted model object.

...

additional arguments passed to methods.

Details

For groups supplied via the models argument of metafrontier the convergence status of the external fitter is not tracked, and the corresponding rows carry NA with an explanatory note.

An SFA stage is reported with code 99, and as not converged, when the log-likelihood at the optimiser's solution is not finite or exceeds n(-\log\sigma_v - \log(2\pi)/2). No model with N(0, \sigma_v^2) noise can attain a higher value, so such a solution is a numerical failure even when the optimiser itself reported success. The check is applied to the stored fit, so it also covers objects created with earlier versions of the package.

Value

A data frame of class "metafrontier_convergence" with one row per estimation stage and columns:

stage

stage label, e.g. "group: G1" or "metafrontier"

method

how the stage was estimated: "MLE", "LP", "QP", "QP (barrier)", "DEA", or "external"

code

the integer convergence code returned by the optimiser (0 indicates success), or 99 for a numerical failure (see Details); NA for DEA stages and externally fitted groups

converged

logical convergence indicator; for DEA stages TRUE unless any efficiency score is NA (infeasible programme); NA for externally fitted groups

note

additional detail, e.g. the number of infeasible DEA programmes or the reason for code 99

Examples

sim <- simulate_metafrontier(n_groups = 2, n_per_group = 50, seed = 42)
fit <- metafrontier(log_y ~ log_x1 + log_x2, data = sim$data,
                    group = "group")
check_convergence(fit)


metafrontier documentation built on Oct. 28, 2026, 5:13 p.m.