Skip to contents

Converts the estimated theta coefficients (\(\theta_j\)'s) into an adjacency matrix representing the regulatory network between variables. Currently, only the non-interaction model (interaction = FALSE) is supported.

Usage

theta_to_adj_matrix(interaction_term, res_theta)

Arguments

interaction_term

A logical value specifying whether to include interaction effects in the model.

res_theta

A numeric matrix whose columns contain the estimated \(\theta_j\) values for each variable.

  • If interaction_term = FALSE, res_theta must have dimensions (p, p).

  • If interaction_term = TRUE, res_theta must have dimensions (p^2, p).

Value

A numeric adjacency matrix of dimension (p, p) representing the regulatory network, where 1 indicates a regulatory effect and 0 indicates none. If interaction_term = TRUE, a fully connected network is returned with a warning.

Examples

set.seed(1)
p <- 3
theta_mat <- matrix(runif(p^2) * rbinom(p^2, 1, 0.5), nrow = p, ncol = p)
theta_to_adj_matrix(interaction_term = FALSE, res_theta = theta_mat)
#>      [,1] [,2] [,3]
#> [1,]    0    1    0
#> [2,]    0    0    1
#> [3,]    0    1    1