Skip to contents

get_pcor() extracts the selected partial correlation matrix 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_pcor(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 partial correlation matrix is not the selected one.

index_lw

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

index_lb

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

Value

get_pcor() returns the selected partial correlation matrix.

Details

If the input is a coglasso object, it is necessary to specify all the indexes to extract the chosen partial correlation matrix.
If the input is a select_coglasso object, it extracts by default the selected partial correlation matrix. If the selection method was "ebic", and you want to extract a different partial correlation matrix than the selected one, specify all indexes. Otherwise, if the objective is to extract the optimal partial correlation matrix 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 partial correlation matrix 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_pcor <- get_pcor(sel_cg)
print(sel_pcor)
#>             Cirbp Hspa5 Hsp90b1 Dnajb11 Trp PC aa C36:3
#> Cirbp           1     0       0       0   0           0
#> Hspa5           0     1       0       0   0           0
#> Hsp90b1         0     0       1       0   0           0
#> Dnajb11         0     0       0       1   0           0
#> Trp             0     0       0       0   1           0
#> PC aa C36:3     0     0       0       0   0           1
# }