# obtain some (high-dimensional) data
p <- 8
n <- 100
set.seed(333)
Y <- matrix(rnorm(n*p), nrow = n, ncol = p)
# create sparse precision
P <- covML(Y)
P[1:3, 6:8] <- 0
P[6:8, 1:3] <- 0
# draw some data
S <- covML(matrix(rnorm(n*p), nrow = n, ncol = p))
# obtain (triangulated) support info
zeros <- which(P==0, arr.ind=TRUE)
supportP <- support4ridgeP(adjMat=adjacentMat(P))
# alternative specification of the support
zeros <- which(P==0, arr.ind=TRUE)
supportP <- support4ridgeP(nNodes=p, zeros=zeros)
# estimate precision matrix with known (triangulated) support
Phat <- ridgePchordal(S, 0.1, zeros=supportP$zeros,
cliques=supportP$cliques, separators=supportP$separators)
Run the code above in your browser using DataLab