qpI2K {qpgraph} | R Documentation |
Builds a random concentration matrix containing zeroes on those entries associated to pairs of variables that are disconnected on a given undirected graph.
qpI2K(I, verbose=FALSE, R.code.only=FALSE)
I |
incidence matrix of an undirected graph. |
verbose |
show progress on the calculations. |
R.code.only |
logical; if FALSE then the faster C implementation is used (default); if TRUE then only R code is executed. |
The random concentration matrix is built by first generating a matrix of
random correlations using the method from Marsaglia and Oltkin (1984). Second,
this matrix is inverted to obtain an initial random covariance matrix. Third,
this covariance matrix is adjusted to the independence constraints of the input
undirected graph by using the function qpIPF
and finally is
inverted to obtain the final random concentration matrix.
A random concentration matrix with zeroes at the empty adjacencies of the undirected graph defined by the input incidence matrix.
R. Castelo and A. Roverato
Castelo, R. and Roverato, A. A robust procedure for Gaussian graphical model search from microarray data with p larger than n. J. Mach. Learn. Res., 7:2621-2650, 2006.
nVar <- 50 # number of variables maxCon <- 5 # maximum connectivity per variable I <- qpRndGraph(n.vtx=nVar, n.bd=maxCon) K <- qpI2K(I) realI <- K != 0 diag(realI) <- FALSE sum(realI) / 2 sum(I) / 2 # all present edges (dependencies) in realI must be in I identical(I & realI, realI) # all missing edges (independencies) in I must be in realI identical(!I & !realI, !I)