Skip to contents

get_network() extracts the selected network from a select_coglasso object, or a different specific one from either a select_coglasso or a coglasso object when specifying the optional parameters.

Usage

get_network(sel_cg_obj, index_c = NULL, index_lw = NULL, index_lb = NULL)

Arguments

sel_cg_obj

The object of S3 class select_coglasso or of S3 class coglasso.

index_c

The index of the \(c\) value different from the one selected by model selection. To set only if the desired network is not the selected one.

index_lw

The index of the \(\lambda_w\) value of the chosen non-optimal network. To set only if the desired network is not the selected one.

index_lb

The index of the \(\lambda_b\) value of the chosen non-optimal network. To set only if the desired network is not the selected one.

Value

get_network() returns the selected network, in the form of an object of class igraph.

Details

If the input is a coglasso object, it is necessary to specify all the indexes to extract a selected network.
If the input is a select_coglasso object, it extracts by default the selected network. If the selection method was "ebic", and you want to extract a different network than the selected one, specify all indexes. Otherwise, if the objective is to extract the optimal network for a specific \(c\) value different than the selected one, set index_c to your chosen one. Also here it is possible to extract a specific non-optimal network by setting all the indexes to the chosen ones.

Examples

# \donttest{
sel_cg <- bs(multi_omics_sd_micro, p = c(4, 2), nlambda_w = 3, nlambda_b = 3,
                 nc = 3, verbose = FALSE)
sel_net <- get_network(sel_cg)
# Could even plot the selected network with plot(sel_net), but then it would
# plot an unnotated network, better to directly plot(sel_cg).
print(sel_net)
#> IGRAPH 0b54f71 UN-- 6 0 -- 
#> + attr: name (v/c), label (v/c)
#> + edges from 0b54f71 (vertex names):
# }