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.
library(ERRI)
dat <- erri_example_data()
head(dat)
#> region year income
#> 1 North 2010 82.0
#> 2 North 2011 84.3
#> 3 North 2012 85.5
#> 4 North 2013 88.4
#> 5 North 2014 90.1
#> 6 North 2015 92.8The 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
#> Economic Resilience and Recovery Index (ERRI)
#> Counterfactual: trend | Scale: sd
#>
#> unit shock_depth cumulative_loss recovery_time recovered stability_ratio
#> North 2.4 4.6 3 TRUE 20
#> Central 2.8 12.9 6 FALSE 16
#> South 1.6 2.7 2 TRUE 19
#> transformation ERRI
#> 0.15 65
#> 0.00 17
#> 0.13 85Residual 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")
#> unit measure estimate lower upper
#> 7 North ERRI 65.14507 60.65423 81.55388
#> 14 Central ERRI 16.66667 0.00000 16.66667
#> 21 South ERRI 85.00570 76.14313 98.86119
rank_probability(boot)
#> North Central South
#> North 0.5000000 1.0 0.06060606
#> Central 0.0000000 0.5 0.00000000
#> South 0.9393939 1.0 0.50000000The default weights are equal. The following analysis draws random weights from the simplex and recalculates scores and rankings.
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.