MixedGraph is the main function of the package, it uses the BRAIL to do the regression.

MixedGraph(X, crf_structure, family = NULL, rule = c("AND", "OR"),
  brail_control = NULL)

Arguments

X

is a list containing k matrices, each of the matrices has n rows and pk columns. They are the 'blocks'. Each block should have all columns of the same type.

crf_structure

is a K-by-K matrix giving the structure of the CRF

  • element (i, j) is 1 if there are directed edges going from the i-th block to the j-th block;

  • element (i, j) is 0 if there are no edges going from the i-th block to the j-th block;

  • element (i, i) is 1 if there are undirected edges within the i-th block;

  • element (i, i) is 0 if there are not undirected edges within the i-th block

family

is a K vector giving the data types for each blocks. The type could be "gaussian", "binomial" or "poisson". If NULL, we can use a heuristic to guess the right value

rule

says whether to use the "AND" or "OR" rule

brail_control

is a list of optional arguments to be passed to BRAIL internally

Value

the coefficients vector

data

is a list containing k matrices from input

network

is a p * p (sparse) matrix giving the edge weights returned by BRAIL

family

is a K vector giving the data types for each blocks from input, if the input family is NULL, there will be the values guessed in the MixedGraph function

crf_structure

is a K-by-K matrix giving the structure of the CRF from input

stability

is a p * p (sparse) matrix giving the stability scores

rule

"AND" or "OR" rule for edge selection within blocks

Note

The function supports foreach package, so user can register the backend.

Examples

X1 <- matrix(rnorm(12), nrow = 4) X2 <- matrix(rnorm(12), nrow = 4) X <- list(X1, X2) crf_structure <- matrix(c(1, 1, 0, 1), nrow = 2) brail_control <- list(B = 5, tau = 0.6) MixedGraph(X, crf_structure, brail_control = brail_control)
#> $data #> $data[[1]] #> [,1] [,2] [,3] #> [1,] 0.2343405 -1.3337463 0.6675088 #> [2,] -0.9515281 1.7647248 1.3728761 #> [3,] 1.8984394 0.5060634 0.5945820 #> [4,] -1.0427705 -0.6552922 0.8093074 #> #> $data[[2]] #> [,1] [,2] [,3] #> [1,] -0.9293517 -0.11676961 -0.2194639 #> [2,] -0.9688826 -0.04977844 -0.2799220 #> [3,] -0.5634830 0.41253090 -0.1844666 #> [4,] 1.8884887 0.33900622 -1.1310412 #> #> #> $network #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 0.0000000 -0.2888218 -0.19259770 0.000000 0.0000000 0.0000000 #> [2,] 0.0000000 0.0000000 0.15247658 0.000000 0.0000000 0.0000000 #> [3,] -3.0133640 0.0000000 0.00000000 0.000000 0.0000000 0.0000000 #> [4,] -0.5548038 -0.4676904 -0.08437963 0.000000 0.1156798 -0.3241862 #> [5,] 0.0000000 0.0000000 0.00000000 0.000000 0.0000000 0.0000000 #> [6,] 0.0000000 0.0000000 -0.03367474 -2.945617 0.0000000 0.0000000 #> #> $family #> [1] "gaussian" "gaussian" #> #> $crf_structure #> [,1] [,2] #> [1,] 1 0 #> [2,] 1 1 #> #> $stability #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 0.0 1.0 1.0 0.0 0 0.0 #> [2,] 0.2 0.0 0.6 0.0 0 0.0 #> [3,] 0.4 0.4 0.0 0.0 0 0.0 #> [4,] 1.0 0.6 1.0 0.0 1 0.6 #> [5,] 0.2 0.2 0.0 0.0 0 0.0 #> [6,] 0.2 0.0 0.8 0.6 0 0.0 #> #> $rule #> [1] "AND" #> #> attr(,"class") #> [1] "MixedGraph"