deviation_metrics {ecoregime}R Documentation

Metrics of trajectory deviation with respect to a reference trajectory

Description

Set of metrics to analyze the deviation of disturbed trajectories from an ecological dynamic regime (EDR) considering a representative trajectory as the reference. These metrics include the resistance to the disturbance, amplitude, recovery, and net change.

Usage

resistance(
  d,
  trajectories,
  states,
  disturbed_trajectories,
  disturbed_states,
  predisturbed_states = disturbed_states - 1
)

amplitude(
  d,
  trajectories,
  states,
  disturbed_trajectories,
  disturbed_states,
  predisturbed_states = disturbed_states - 1,
  reference,
  index = c("absolute", "relative"),
  method = "nearest_state"
)

recovery(
  d,
  trajectories,
  states,
  disturbed_trajectories,
  disturbed_states,
  reference,
  index = c("absolute", "relative"),
  method = "nearest_state"
)

net_change(
  d,
  trajectories,
  states,
  disturbed_trajectories,
  disturbed_states,
  predisturbed_states = disturbed_states - 1,
  reference,
  index = c("absolute", "relative"),
  method = "nearest_state"
)

Arguments

d

Either a symmetric matrix or an object of class dist containing the dissimilarities between each pair of states.

trajectories

Vector indicating the trajectory or site to which each state in d belongs.

states

Vector of integers indicating the order of the states in d for each trajectory.

disturbed_trajectories

Vector of the same class as trajectories indicating the identifier of the disturbed trajectories.

disturbed_states

Vector of integers included in statesindicating the first state after the release of the disturbance for each value in disturbed_trajectories.

predisturbed_states

Vector of integers included in states indicating the last undisturbed state of each disturbed_trajectories. The previous states to disturbed_states are considered by default.

reference

Object of class RETRA indicating the representative trajectory taken as the reference to compute the amplitude, recovery, and net_change of the disturbed trajectories (see Details).

index

Method to calculate amplitude, recovery, or net change ("absolute", "relative"; see Details).

method

Method to calculate the distance between the disturbed_states or predisturbed_states and the reference trajectory. One of "nearest_state", "projection" or "mixed" (see Details).

Details

Resistance (resistance())

Resistance captures the immediate impact of the disturbance as a function of the changes in the state variables (Sánchez-Pinillos et al., 2019).

Rt = 1 - d_{pre,dist}

Amplitude (amplitude())

Amplitude indicates the direction in which the system is displaced during the disturbance in relation to the reference (Sánchez-Pinillos et al., 2024). Positive values indicate that the disturbance displaces the system towards the boundaries of the dynamic regime. Negative values indicate that the disturbance displaces the system towards the representative trajectory.

Two indices can be calculated:

If index = "absolute",

A = d_{dist,RT} - d_{pre,RT}

If index = "relative",

A = \frac{d_{dist,RT} - d_{pre,RT}}{d_{pre,dist}}

Recovery (recovery())

Recovery quantifies the ability of the system to evolve towards the reference following the relief of the disturbance (if positive) or move in the direction of the boundaries of the dynamic regime (if negative) (Sánchez-Pinillos et al., 2024).

Two indices can be calculated:

If index = "absolute",

Rc = d_{dist,RT} - d_{post,RT}

If index = "relative",

Rc = \frac{d_{dist,RT} - d_{post,RT}}{d_{dist,post}}

Net change (net_change())

Net change quantifies the proximity of the system to the reference relative to the pre-disturbed state (Sánchez-Pinillos et al., 2024). Positive values indicate that the system eventually evolves towards the boundaries of the dynamic regime. Negative values indicate that the system eventually evolves towards the reference.

Two indices can be calculated:

If index = "absolute",

NC = d_{post,RT} - d_{pre,RT}

If index = "relative",

NC = \frac{d_{post,RT} - d_{pre,RT}}{d_{pre,post}}

In all cases:

d_{pre,RT}, d_{dist,RT}, and d_{post,RT} are calculated using the function state_to_trajectory() by three different methods:

Value

Author(s)

Martina Sánchez-Pinillos

References

Sánchez-Pinillos, M., Leduc, A., Ameztegui, A., Kneeshaw, D., Lloret, F., & Coll, L. (2019). Resistance, resilience or change: Post-disturbance dynamics of boreal forests after insect outbreaks. Ecosystems 22, 1886-1901 https://doi.org/10.1007/s10021-019-00378-6

Sánchez-Pinillos, M., Dakos, V., & Kéfi, S. (2024). Ecological dynamic regimes: A key concept for assessing ecological resilience. Biological Conservation 289, 110409 https://doi.org/10.1016/j.biocon.2023.110409

See Also

retra_edr() to identify representative trajectories in an ecological dynamic regime.

define_retra() to generate an object of classRETRA.

state_to_trajectory() to calculate the position of a state with respect to a trajectory.

Examples

# Identify the representative trajectories of the EDR from undisturbed trajectories
RT <- retra_edr(d = EDR_data$EDR3$state_dissim,
                trajectories = EDR_data$EDR3$abundance$traj,
                states = as.integer(EDR_data$EDR3$abundance$state),
                minSegs = 5)

# Abundance matrix including disturbed and undisturbed trajectories
abundance <- rbind(EDR_data$EDR3$abundance,
                   EDR_data$EDR3_disturbed$abundance, fill = TRUE)

# State dissimilarities (Bray-Curtis) for disturbed and undisturbed trajectories
d <- vegan::vegdist(abundance[, paste0("sp", 1:12)], method = "bray")

# Resistance
Rt <- resistance(d = d, trajectories = abundance$traj, states = abundance$state,
                 disturbed_trajectories = unique(abundance[!is.na(disturbed_states)]$traj),
                 disturbed_states = abundance[disturbed_states == 1]$state)

# Amplitude
A <- amplitude(d = d, trajectories = abundance$traj, states = abundance$state,
               disturbed_trajectories = unique(abundance[!is.na(disturbed_states)]$traj),
               disturbed_states = abundance[disturbed_states == 1]$state, reference = RT)

# Recovery
Rc <- recovery(d = d, trajectories = abundance$traj, states = abundance$state,
               disturbed_trajectories = unique(abundance[!is.na(disturbed_states)]$traj),
               disturbed_states = abundance[disturbed_states == 1]$state, reference = RT)

# Net change
NC <- net_change(d = d, trajectories = abundance$traj, states = abundance$state,
                 disturbed_trajectories = unique(abundance[!is.na(disturbed_states)]$traj),
                 disturbed_states = abundance[disturbed_states == 1]$state, reference = RT)


[Package ecoregime version 0.2.0 Index]