Jackknife-After in JaB Algorithm for Networks
Source:R/get-jackknife-after.R
get_jackknife_after.Rd
This function performs the "Jackknife-after" portion of the Jackknife-after-Bootstrap (JaB) algorithm for networks.
Usage
get_jackknife_after(
network,
boot.result,
quant,
func.name,
package.name = NULL,
func.args = NULL,
nodes = NULL
)
Arguments
- network
An igraph object representing the original network.
- boot.result
A list of bootstrap network samples, as produced by a
bootstrap_
function.- quant
A numeric value specifying the upper quantile used to flag influential nodes (e.g.,
0.95
).- func.name
A character string specifying the centrality function to be applied (e.g.,
"degree"
,"betweenness"
). Seeget_centrality
for details.- package.name
(Optional) A character string specifying the package containing
func.name
. Seeget_centrality
for details.- func.args
(Optional) A list of additional arguments for
func.name
. Seeget_centrality
for details.- nodes
(Optional) A vector of node names to run JaB algorithm for. If
NULL
, algorithm will be run on all \(n\) nodes innetwork
.
Value
A data frame containing:
Node_Number
: Numeric IDs of nodes.Node_Name
: Name of nodes.Orig_Stat
: The original centrality statistic of each node.Boot_mean
,boot_sd
,boot_skew
: The mean, standard deviaiton, and skewness of the elements of \(\Gamma_i\)Upper_Quantile
: Upper quantile of the jackknife-after-bootstrap distribution of centrality statistic for each node.Influential
: Logical indicating if each node is influential, i.e. isOrig_Stat
greater thanUpper_Quantile
?Rank
: Rank from most (1) to least (\(n\)) influential. There can be ties in the rankings.Can_Jackknife
: Logical indicating if there were bootstrap samples that did not include that node, meaning there are jackknife-after sample to generate the distribution of centrality statistics in networks that do not contain that node. IfFALSE
, then all bootstrap samples contained that node and theUpper_Quantile
column will generally beNA
. If many nodes areFALSE
it could mean that the bootstrap method is poorly tuned and is sampling more nodes that is appropriate for this data set. If only a few nodes areFALSE
it could mean the bootstrap method is poorly tuned for this data set, or it could mean that the node is extremely influential as it is highly improbable to generate a bootstrap sample that does not contain that node. Which explanation is appropriate depends on the data set and the bootstrap method used.Num_Boot_Samps
: Number of bootstrap samples used to construct the distribution in the Jackknife-after step. If there are \(B\) bootstrap samples inboot.result
, then \(B - Num_Boot_Samps\) bootstrap samples contained node \(v_i\) and, \(Num_Boot_Samps\) did not contain node \(v_i\) IfCan_Jackknife
isFALSE
, then this number will be 0 (i.e. all bootstrap samples contained node \(v_i\) and thus none of them can be used in the Jackknife-after step).
Details
This function performs the "jackknife-after" portion of the JaB algorithm for
network data. See jab_network()
wrapper function for entire algorithm.
Examples
library(igraphdata)
library(igraph)
data(karate)
#first get bootstrap samples
boot.result <- bootstrap_snowboot(karate, B = 100, num.seed = 1, num.wave = 2)
#> This graph was created by an old(er) igraph version.
#> Call upgrade_graph() on it to use with the current igraph version
#> For now we convert it on the fly...
#then do jackknife-after
get_jackknife_after(network = karate,
boot.result = boot.result,
quant = 0.9,
func.name = "degree",
package.name = "igraph",
func.args = list(normalized = TRUE),
nodes = NULL)
#> # A tibble: 34 × 11
#> Node_Number Node_Name Orig_Stat Boot_mean Boot_sd Boot_skew Upper_Quantile
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Mr Hi 0.485 0.137 0.174 162. 0.235
#> 2 34 John A 0.515 0.136 0.171 142. 0.286
#> 3 33 Actor 33 0.364 0.137 0.172 148. 0.235
#> 4 3 Actor 3 0.303 0.137 0.179 191. 0.4
#> 5 28 Actor 28 0.121 0.137 0.172 148. 0.235
#> 6 29 Actor 29 0.0909 0.137 0.172 148. 0.235
#> 7 24 Actor 24 0.152 0.134 0.174 125. 0.36
#> 8 25 Actor 25 0.0909 0.140 0.150 44.0 0.3
#> 9 26 Actor 26 0.0909 0.145 0.157 39.6 0.3
#> 10 6 Actor 6 0.121 0.135 0.178 125. 0.333
#> # ℹ 24 more rows
#> # ℹ 4 more variables: Influential <lgl>, Rank <int>, Can_Jackknife <lgl>,
#> # Num_Boot_Samps <int>