R Under development (unstable) (2024-02-05 r85863 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(pcalg) > source(system.file(package="Matrix", "test-tools-1.R", mustWork=TRUE)) Loading required package: tools > ##--> showProc.time(), assertError(), relErrV(), ... > > set.seed(234) > p <- 10 > nreps <- 30 > resG <- resP <- rep(FALSE,nreps) > for (i in 1:nreps) { + ## generate and draw random DAG : + myDAG <- randomDAG(p, prob = 0.3) + mycor <- cov2cor(trueCov(myDAG)) + amat <- wgtMatrix(myDAG) + amat[amat!=0] <- 1 + amat <- amat + t(amat) + amat[amat!=0] <- 1 + + ## Gaussian + suffStat <- list(C = cov2cor(trueCov(myDAG)), n = 10^9) + indepTest <- gaussCItest + + resU <- skeleton(suffStat, indepTest, 0.99, p = p, + method = ifelse(i < nreps/2, "stable", "stable.fast")) + + resG[i] <- all(as(resU@graph,"matrix") == amat) + resP[i] <- all(resU@pMax[as(resU@graph,"matrix") == TRUE] < 0.99) + } > showProc.time() Time (user system elapsed): 1.17 0.06 1.24 > > if (!all(resG)) stop("Test skeleton wrong: Some skeleton was not found correctly!") > if (!all(resP)) stop("Test skeleton wrong: There was an inconsistency with an entry in pMax!") > > (doExtras <- pcalg:::doExtras()) [1] FALSE > if(!doExtras && !interactive()) q("no") > proc.time() user system elapsed 2.23 0.20 2.45