Stability: stability

View source: R/runELA.R

StabilityR Documentation

stability

Description

Calculate energy gap and stable state entropy as stability indices and returns a dataframe.

For each sample state, this function identifies the basin (stable state) by Bi, then computes (i) the energy gap and (ii) stable state entropy estimated by SSentropy. If enmat is provided and sa was estimated with environmental factors, the basin assignment is computed for each sample-specific env.

Note: the returned stable state id corresponds to the basin (stable state) the sample is assigned to.

Usage

Stability(
  sa,
  ocmat,
  enmat = NULL,
  seitr = 1000,
  seconvTime = 10000,
  threads = 1,
  reporting = TRUE
)

Arguments

sa

: output of runSA function.

ocmat

: array of the vectors of presence/absence status for each sample.

enmat

: array of the vectors of environmental factors for each sample. Normalization required.

seitr

: Number of stochastic search iterations.

seconvTime

: Maximum number of iterations for each search.

threads

: number of cores (threads) used for calculation.

reporting

: enable/disable the reporting function.

Value

A data frame with stability indices. Columns include at least energy.gap, ss.entropy, e.realize, e.stable, state.id, and stable.state.id (and may include conv_time and convergence depending on the branch).


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