| extract_probs {PLNmodels} | R Documentation |
Extracts edge selection frequency in networks reconstructed from bootstrap subsamples during the stars stability selection procedure, as either a matrix or a named vector. In the latter case, edge names follow igraph naming convention.
extract_probs(
Robject,
penalty = NULL,
index = NULL,
crit = c("StARS", "BIC", "EBIC"),
format = c("matrix", "vector"),
tol = 1e-05
)
Robject |
an object with class |
penalty |
penalty used for the bootstrap subsamples |
index |
Integer index of the model to be returned. Only the first value is taken into account. |
crit |
a character for the criterion used to performed the selection. Either
"BIC", "ICL", "EBIC", "StARS", "R_squared". Default is |
format |
output format. Either a matrix (default) or a named vector. |
tol |
tolerance for rounding error when comparing penalties. |
Either a matrix or named vector of edge-wise probabilities. In the latter case, edge names follow igraph convention.
data(trichoptera) trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate) nets <- PLNnetwork(Abundance ~ 1 + offset(log(Offset)), data = trichoptera) ## Not run: stability_selection(nets) probs <- extract_probs(nets, crit = "StARS", format = "vector") probs ## End(Not run) ## Not run: ## Add edge attributes to graph using igraph net_stars <- getBestModel(nets, "StARS") g <- plot(net_stars, type = "partial_cor", plot=F) library(igraph) E(g)$prob <- probs[as_ids(E(g))] g ## End(Not run)