robustness_lbm {robber} | R Documentation |
Robustness for LBM
Description
Compute the robustness for a given set of Latent Block Model parameters.
Usage
robustness_lbm(
con = NULL,
pi = NULL,
rho = NULL,
nr = NULL,
nc = NULL,
ext_seq = "uniform",
method = "exact",
approx_threshold = 10000,
net = NULL,
...
)
Arguments
con |
A matrix, the connectivity parameter |
pi |
A vector of length |
rho |
A vector of length |
nr |
An integer, the number of row (primary) species |
nc |
An integer, the number of column (secondary) species |
ext_seq |
A string, the rule for the primary extinctions sequences, one of:
|
method |
A string, the method used to compute the robustness by block. One of:
|
approx_threshold |
A numeric, the maximum size of the possible block
partition allowed for exact robustness by block calculation. Higher threshold
gives more precise results at the cost of computation times and possibly memory
problem. Do not do anything for |
net |
A network, if given, the function will fit a LBM to obtain the parameters of the network and then compute the robustness. |
... |
Option to be passed to get_ |
Value
A list and a robber type object:
-
$fun
the robustness function, a vector of sizenr +1
-
$auc
the area under the curve of the robustness function -
$block
a vector of sizelength(pi)
, the block ordering for primary extinctions sequence by blocks.NULL
ifext_seq = "uniform"
. -
$model
,$method
,$ext_seq
,$param
.
Examples
con <- matrix(c(.5,.3,.3,.1), 2, 2)
pi <- c(.25,.75)
rho <- c(1/3, 2/3)
nr <- 50
nc <- 30
my_rob <- robustness_lbm(con, pi, rho, nr, nc, ext_seq = "natural")
my_rob$fun
my_rob$auc
# A easier alternative way, if you don't know the parameters of the network:
data(hostparasite)
(robustness_lbm(net = hostparasite, ncores = 1L))