calc_QSS_extinction_dif: Calculates the QSS difference between the full network and...

View source: R/calcExtinctionIndices.r

calc_QSS_extinction_difR Documentation

Calculates the QSS difference between the full network and the network minus one species

Description

The QSS determines the maximum eingenvalue of the community matrix (Jacobian) and characterizes the linear stability of the network. This uses the function calc_QSS() so it can take into account the interaction strength if weights are present. The comparison is made using the Anderson-Darling test with the function kSamples::ad.test() and the Kolmogorov-Smirnov test stats::ks.test(), both the p-values are reported as a measure of strength of the diference. If istrength is TRUE it makes a comparison to a null model with the same species and links than the reduced network but with all interaction strengths equal to the mean interacion strength.

Usage

calc_QSS_extinction_dif(g, sp_list, nsim = 1000, ncores = 4, istrength = FALSE)

Arguments

g

igraph network

sp_list

list with the species/nodes we will delete for the comparison

nsim

number of simulations to calculate QSS

ncores

number of cores used to perform the operation

istrength

if TRUE takes the weigth attribute of the network as interaction strength to calculate QSS.

Value

a data.frame with:

  • the node deleted

  • the Anderson-Darling p-value of the comparison with the complete network

  • Kolmogorov-Smirnov p-value of the comparison with the complete network

  • If istrength == TRUE the Anderson-Darling p-value of the comparison with the null network

  • If istrength == TRUE Kolmogorov-Smirnov p-value of the comparison with the null network

  • median of QSS of the complete network

  • median of QSS of the network with the deleted node

  • difference between the two previous median QSS

  • If istrength == TRUE median of QSS of the null network

  • If istrength == TRUE difference between the median QSS of the network with the deleted node and the null network.

Examples

## Not run: 
g <- netData[[1]]

# Generate random weights
#
V(g)$weight <-  runif(vcount(g))

# Without interaction strength
#
calc_QSS_extinction_dif(g,V(g)$name[1:3],nsim=10,istrength = FALSE)

# With interaction strength
#
calc_QSS_extinction_dif(g,V(g)$name[1:3],nsim=10,istrength = TRUE)

## End(Not run)

lsaravia/EcoNetwork documentation built on Feb. 27, 2023, 6:43 a.m.