require(graph)
require(mvtnorm)
nVar <- 50 ## number of variables
nObs <- 10 ## number of observations to simulate
set.seed(123)
g <- randomEGraph(as.character(1:nVar), p=0.15)
Sigma <- qpG2Sigma(g, rho=0.5)
X <- rmvnorm(nObs, sigma=as.matrix(Sigma))
pcc.estimates <- qpPCC(X)
## get the corresponding boolean adjacency matrix
A <- as(g, "matrix") == 1
## Pearson correlation coefficients of the present edges
summary(abs(pcc.estimates$R[upper.tri(pcc.estimates$R) & A]))
## Pearson correlation coefficients of the missing edges
summary(abs(pcc.estimates$R[upper.tri(pcc.estimates$R) & !A]))
Run the code above in your browser using DataLab