gStability: gstability

View source: R/runELA.R

gStabilityR Documentation

gstability

Description

Calculate energy gap, energy barrier and stable state entropy.

This function evaluates stability indices for both (i) the pruned and (ii) the non-pruned energy landscape. For each sample, it assigns the basin by Bi and computes: - energy gap (sample energy minus basin energy), - energy barrier (minimum tipping energy connected to the basin minus basin energy), - stable state entropy (SSentropy).

For basin connectivity: when only one stable state exists, tipping energy is treated as Inf and therefore energy barrier is returned as Inf.

Usage

gStability(
  sa,
  ocmat,
  enmat = NULL,
  seitr = 1000,
  seconvTime = 10000,
  pruning_type = "relative",
  th = 0.1,
  lower_qr = 0.05,
  threads = 1,
  reporting = TRUE,
  bs_params = NULL
)

Arguments

sa

: output of runSA function.

ocmat

: matrix of presence/absence status for each sample.

enmat

: matrix of environmental factors for each sample. Normalization required.

seitr

: Number of stochastic search iterations.

seconvTime

: Maximum number of iterations for each search.

pruning_type

the type of pruning "relative"(use with th) or "bootstrap" (use with lower_qr and bootstrap_ene)

th

: Numerical (0~1). Ratio of the depth of the basin to be pruned with respect to the deepest basin in each pair.

lower_qr

Numeric value. Quantile used for constructing confidence intervals from bootstrap samples to check whether the estimated energy gaps include zero. Default is lower_qr = 0.05,necessary when type="bootstrap".

threads

number of cores (threads) used for calculation.#' @param threads : number of cores (threads) used for calculation.

reporting

: enable/disable the reporting function.

bs_params

output of bootstrap_SA. list of estimated parameters using bootstrap resampled data set, necessary when type="bootstrap".

Value

A list of four elements: (1) pruned stability data frame, (2) non-pruned stability data frame, (3) auxiliary object for pruned landscape (parameters + stable states table), and (4) auxiliary object for sample-wise evaluation (inputs and ELA objects).


ELAplus documentation built on May 28, 2026, 5:09 p.m.