require(mvtnorm)
nVar <- 50 ## number of variables
maxCon <- 5 ## maximum connectivity per variable
nObs <- 30 ## number of observations to simulate
set.seed(123)
A <- qpRndGraph(p=nVar, d=maxCon)
Sigma <- qpG2Sigma(A, rho=0.5)
X <- rmvnorm(nObs, sigma=as.matrix(Sigma))
nrr.estimates <- qpNrr(X, q=1, verbose=FALSE)
nrr.prerec <- qpPrecisionRecall(nrr.estimates, A, decreasing=FALSE,
recallSteps=seq(0, 1, by=0.1))
qpPRscoreThreshold(nrr.prerec, level=0.5, recall.level=TRUE, max.score=0)
qpPRscoreThreshold(nrr.prerec, level=0.5, recall.level=FALSE, max.score=0)
Run the code above in your browser using DataLab