The file 'script R.txt' contains the code for all simulations, experiments, and graphical elements of the associated paper.
This piece of code runs sparse/dense network simulations and compares crude estimation with boosted logistic regression, bagged random causal networks (few/many bags, with/without prior knowledge), and full DAG learning. All parameters (including number of iterations, desired number of successful runs, etc) are customizable at the top of the script. The code writes the interim results on file every x iterations.
This is ancillary code to be used to draw boxplots of average tretament effect errors for the main simulation script.
This part draws example DAGs with pre-specified confounder/collider structures.
This part shows how to use the Rgraphviz graphical library to draw DAGs with flexible layout and color them as needed.
This portion of the script tests the time benchmarks of the full DAG learning algorithms vs. the bagged estimators. The code compares hill-climbing with grow-shrink but the functions can be replaced by other learners.
This code checks what is the best curve fit for the time benchmark results, i.e. empirical complexity (testing linear, quadratic, cubic, fourth power, and other types).
Here, an example of the GAC application with multiple adjustement sets on a random DAG is given. The drawing is made using the ggdag library.
This portion of the code applies the DAG/GAC framework and the bagged random causal network to the Class III Malocclusion dataset (the data are downloaded on the fly using the public url).