boot_tgr: Bootstrap Confidence Intervals for the Technology Gap Ratio

View source: R/bootstrap.R

boot_tgrR Documentation

Bootstrap Confidence Intervals for the Technology Gap Ratio

Description

Computes bootstrap confidence intervals for TGR estimates from a fitted metafrontier model. Supports both parametric (residual resampling) and nonparametric (case resampling) bootstraps.

Usage

boot_tgr(
  object,
  R = 999,
  type = c("parametric", "nonparametric"),
  level = 0.95,
  ci_type = c("percentile", "bca"),
  seed = NULL,
  progress = TRUE,
  ncores = 1L,
  ...
)

Arguments

object

a "metafrontier" object fitted from formula, data and group. Metafrontiers built from pre-fitted models are not supported, because the group models cannot be re-estimated on bootstrap samples.

R

integer. Number of bootstrap replications (default 999).

type

character. "parametric" resamples from estimated error distributions; "nonparametric" resamples rows within groups with replacement.

level

numeric. Confidence level (default 0.95).

ci_type

character. "percentile" (default) or "bca" (bias-corrected and accelerated). Applies to the observation-level intervals of the parametric bootstrap; the group-level intervals are always percentile intervals.

seed

optional integer seed for reproducibility.

progress

logical. Show progress bar (default TRUE).

ncores

integer. Number of CPU cores for parallel bootstrap (default 1, sequential). Requires the parallel package.

...

additional arguments passed to metafrontier.

Details

The parametric bootstrap keeps the design fixed and redraws the response, so column i of tgr_boot is the TGR of DMU i in every replicate. It returns observation-level intervals (ci) as well as group-level intervals. Because every replicate re-estimates the group frontiers before rebuilding the metafrontier, the intervals carry the first-stage (group frontier) estimation uncertainty into the TGR, for the deterministic as well as the stochastic metafrontier.

The nonparametric bootstrap resamples rows with replacement within each group, stacks the resampled rows group by group in the order of groups, and refits the model. Column j of tgr_boot is then the j-th resampled unit, a random draw from group boot_group[j], not DMU j. The group-level intervals are computed over these position blocks and do not depend on the row order of the data. No observation-level intervals are returned (ci is NULL): a column is not tied to any DMU, and evaluating the original DMUs against each bootstrap frontier instead is, for DEA, the naive bootstrap, which is inconsistent (Kneip, Simar and Wilson, 2008). For SFA fits, observation-level intervals are available from the parametric bootstrap.

Group-level intervals are percentile intervals of the within-group mean (ci_group) and median (ci_group_median) of the TGR across replicates. Rows dropped from the fit because of missing values are left out of both bootstraps.

Value

An object of class "boot_tgr" containing:

tgr_boot

R x n matrix of bootstrapped TGR values. For the parametric bootstrap, column i is DMU i; for the nonparametric bootstrap, column j is the j-th resampled unit (see Details).

tgr_original

original TGR estimates

ci

n x 2 matrix of observation-level confidence intervals (parametric bootstrap), or NULL (nonparametric bootstrap)

ci_group

data frame of group-level mean TGR intervals

ci_group_median

data frame of group-level median TGR intervals

R_effective

number of successful replications

R

requested number of replications

type

bootstrap type used

ci_type

CI type used

level

confidence level

group_vec

group of each element of tgr_original

boot_group

group of each column of tgr_boot

groups

group labels

References

Kneip, A., Simar, L. and Wilson, P.W. (2008). Asymptotics and consistent bootstraps for DEA estimators in nonparametric frontier models. Econometric Theory, 24(6), 1663–1697. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/S0266466608080651")}

Examples


sim <- simulate_metafrontier(n_groups = 2, n_per_group = 100,
                             seed = 42)
fit <- metafrontier(log_y ~ log_x1 + log_x2,
                    data = sim$data, group = "group",
                    meta_type = "stochastic")
boot <- boot_tgr(fit, R = 50, seed = 1)
print(boot)
confint(boot)

# Nonparametric bootstrap: group-level intervals only
boot_np <- boot_tgr(fit, R = 50, type = "nonparametric", seed = 1)
boot_np$ci_group
boot_np$ci_group_median



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