data(gmG)
identical
to the one generated by
## Used to generate "gmG"
set.seed(40)
p <- 8
n <- 5000
## true DAG:
vars <- c("Author", "Bar", "Ctrl", "Goal", paste0("V",5:8))
gGtrue <- randomDAG(p, prob = 0.3, V = vars)
gmG <- list(x = rmvDAG(n, gGtrue, back.compatible=TRUE), g = gGtrue)
gmG8 <- list(x = rmvDAG(n, gGtrue), g = gGtrue)gmG
: In the previous version, the data generation
wgtMatrix
had the non-zero weights in reversed order for
each node. On the other hand, for gmG8
, the correct weights
were use in all casesdata(gmG)
str(gmG, max=3)
stopifnot(identical(gmG $ g, gmG8 $ g))
if(dev.interactive()) { ## to save time in tests
round(as(gmG $ g, "Matrix"), 2) # weight ("adjacency") matrix
plot(gmG $ g)
pairs(gmG$x, gap = 0,
panel=function(...) smoothScatter(..., add=TRUE))
}
Run the code above in your browser using DataLab