Learn R Programming

sfa (version 1.2.0)

hscore_select: Select the robustness tuning parameter by Hyvarinen score

Description

Refits a Normal--Half-Normal stochastic frontier at each candidate value of the robustness tuning parameter and returns the value minimising the Hyvarinen score of hscore. The search is coarse-to-fine and includes the maximum-likelihood endpoint \(c=0\), so the criterion is free to decline robustification altogether.

Usage

hscore_select(object, method = c("mlqe", "psi", "mdpd"),
              range = c(0, 0.60), coarse = 0.01, fine = 0.001,
              half_width = 0.02, multistart = TRUE, verbose = FALSE)

Value

An object of class "sfa_hscore": the selected tuning parameter c, its criterion value hscore, the whole search path as a data frame, the refitted model fit, and n_finite, how many candidates were scorable out of how many tried.

Arguments

object

A fitted model from sfm with model_name = "NHN", used for the data, the formula and the reference starting values.

method

Robust criterion. "psi" and "mdpd" are the same estimator at a common tuning value.

range

Numeric length-2 search interval.

coarse, fine

Grid steps for the two passes.

half_width

Half-width of the refinement window around the coarse minimum.

multistart

Logical; see Details.

verbose

Logical, print progress.

Reading the result

A flat region around the minimum is not non-identification in the usual sense; it means the criterion discriminates weakly among nearby tuning values. The drop from \(c=0\) to the minimum is a descriptive score difference, not a test of maximum likelihood against a robust alternative. Where the selected value matters, compare it with the fixed calibration from calibrate_c and check its stability by resampling: the selection can be bimodal across resamples even when the full-sample criterion clearly prefers a robust solution.

Details

Two failure modes are guarded here, both of which return a converged fit and a finite criterion value if they are not.

Silent grid loss. The criterion is evaluated in log space (see hscore). Evaluated naively it is non-finite wherever any fitted density underflows, which discards candidates non-randomly -- those nearest maximum likelihood survive -- and so understates the robustness the data call for.

Warm-start capture. Walking the grid upward and warm-starting each fit from the previous one is efficient but unguarded: if one fit falls into the degenerate \(\sigma_u \to 0\) basin, every later fit inherits it. With multistart = TRUE each candidate is fitted from both the warm start and a fixed reference start, keeping the better objective.

References

Sugasawa, S. and Yonekura, S. (2021). On selection criteria for the tuning parameter in robust divergence. Entropy 23(9), 1147.

Bernstein, D.H., Parmeter, C.F. and Wright, I.A. (2026). On Robust Estimation of the Stochastic Frontier Model. Working paper.

See Also

hscore, calibrate_c, density_weights, sfm

Examples

Run this code
# \donttest{
set.seed(3)
n <- 200
x <- runif(n, 1, 10)
y <- 1 + 0.5 * log(x) + rnorm(n, 0, 0.3) - abs(rnorm(n, 0, 0.6))
dat <- data.frame(y = y, x = log(x))
fit <- sfm(y ~ x, data = dat, model_name = "NHN")

sel <- hscore_select(fit, method = "mlqe")
sel
plot(sel$path$c, sel$path$hscore, type = "l",
     xlab = "c", ylab = "Hyvarinen score")
abline(v = sel$c, lty = 3)
# }

Run the code above in your browser using DataLab