These are short explanations on how to use CUSPRA on empirical dataset, as introduced in Sguotti et al. (2024) “Resilience assessment in complex natural systems” Proc. R. Soc. B. 291:20240089 doi 10.1098/rspb.2024.0089
Load the cusp
and cuspra
R packages. To
make sure that you have the last version of the package, you can run
devtools::install_github(repo = "rfrelat/cuspra", dependencies = TRUE, build_vignettes = TRUE)
.
Let’s now load the dataset:
If you use another dataset, make sure to change the name of the
object in the cusp() model with the correct name of columns
(e.g. PC1
should be replaced by Biomass
if you
are using the cod_nea
dataset).
fitNS <- cusp(y ~ PC1, alpha ~ Fishing,
beta ~ Temperature, data=ecosystem_ns)
# Make sure to check the model results
# with summary(), evalcusp(), or visually with plot()
evalcusp(fitNS)
#> rsquared delta.aicc percin pval.state
#> 1 0.8847192 61.91278 41.37931 1.321463e-33
Make sure to check the model results with
summary(fitNS)
, plot(fitNS)
and/or
evalcusp(fitNS)
. The output of evalcusp()
shows: - rsquared
: the pseudo R2 of the cusp model
(should be >0.3)} - delta.aicc
: the
difference between AICc of the linear and cusp model (should be
>0)} - percin
: percentage of points within the
cusp area (should be >10)} -
pval.state
: p-value of the state variable (should
be <0.05)}
The output of the cusp resilience assessment provide 4 columns: - cuspRA: the resilience assessment, with values between 0 (low resilience) and 1 (high resilience) - dalpha: the horizontal component as distance to the cusp area (if negative, the point is inside the cusp area) - dbeta: the vertical component as distance to linearity (if negative the system is discontinuous) - sumd: the weighted average of the horizontal and vertical components (by default the horizontal component has double weight)