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) > suppressWarnings(RNGversion("3.5.0")) > set.seed(34) > g <- randomDAG(5,0.8) > trMat <- matrix(0, 5,5) > trMat[1,5] <- 0.305 > trMat[1,4] <- 0.863 > trMat[1,2] <- 0.354 > trMat[2,4] <- 0.392 > trMat[2,5] <- 0.495 > trMat[3,4] <- 0.278 > > > ## eff 1->5: 0.305 + 0.354*0.495 > trEff <- 0.305 + 0.354*0.495 > estEff <- causalEffect(g, 5,1) > > if (!(round(trEff,3) == round(estEff, 3))) { + stop("Test in wgtMatrix: Weights have wrong value!") + } > > proc.time() user system elapsed 0.76 0.18 0.93