Measuring Economic Resilience and Recovery with ERRI

knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width = 7,
                      fig.height = 4.5)

Purpose

Economic resilience is not a single observed variable. ERRI represents it as six complementary dimensions calculated relative to an estimated no-shock counterfactual. Let the observed outcome for unit $i$ at time $t$ be $Y_{it}$ and its counterfactual be $Y^{(0)}_{it}$. The scaled adverse gap is

$$ G_{it}=\frac{Y^{(0)}{it}-Y{it}}{s_i}, $$

where $s_i$ is the pre-shock standard deviation, absolute mean, or one.

The package measures maximum adverse gap (depth), summed adverse gap (cumulative loss), time required to remain within a tolerance, strength of recovery, post-shock residual volatility relative to pre-shock volatility, and positive performance beyond the counterfactual after recovery.

Example

library(ERRI)
dat <- erri_example_data()
head(dat)

The example contains three fictional regional income series. The shock begins in 2020.

fit <- erri(dat, time = "year", outcome = "income", unit = "region",
            shock_time = 2020, method = "trend", scale = "sd",
            epsilon = 0.25, consecutive = 2)
fit
plot(fit, type = "trajectory", unit = "North")
plot(fit, type = "index")

Uncertainty

Residual bootstrap intervals propagate uncertainty in the pre-shock counterfactual. At least several hundred replications are recommended for an empirical study.

boot <- erri_bootstrap(fit, R = 99, seed = 2026)
subset(boot$intervals, measure == "ERRI")
rank_probability(boot)

Weight sensitivity

The default weights are equal. The following analysis draws random weights from the simplex and recalculates scores and rankings.

sens <- erri_sensitivity(fit, R = 250, seed = 2026)
aggregate(ERRI ~ unit, sens, function(x) c(mean = mean(x), sd = sd(x)))

Interpretation and limitations

A higher score denotes stronger measured resilience under the selected model, scale, tolerance, and weights. The score is not automatically causal. A shock date must be substantively justified, and a trend, mean, or AR(1) counterfactual may be inadequate when other events affect the outcome. Report component estimates, bootstrap intervals, and weight sensitivity rather than only the composite index.



Try the ERRI package in your browser

Any scripts or data that you put into this service are public.

ERRI documentation built on Sept. 28, 2026, 5:08 p.m.