This contains all the simulation code for PDAG. The main function used in generating the tables is located in simulations.R. This requires installation of the partitionDAG package, which in turn requires the pdagDFS package. To install these packages, please type the following commands into R:
install.packages("devtools")
library(devtools)
install_github("shr264/pdagDFS")
install_github("shr264/partitionDAG")
A few of the key files in this repo include:
- amat.Rdata
- data_generating_functions.R
- metric_functions.R
- simulations.R
- pDag_dairy_cattle_data.pdf
- pDag_dairy_cattle_data.Rmd
This file contains the adjacency matrices for Yeast1, Yeast2, Yeast3, Ecoli1, Ecoli2 from the DREAM3 challenge.
This file contains the files to generate the true covariance matrix according the various adjacency matrices incluiding those from the DREAM3 challenge as well as random DAGs.
This file contains functions that calculate various metrics of interest, especially the macro-averaged AUC for DAGs.
This file contains the code to generate the simulations reported in the paper.
This file contains the code to conduct the analysis of the dairy cattle data.
This file contains the output for the analysis of the dairy cattle data.
To generate all the data for the tables, open up bash and type:
Rscript simulations.R
In particular, the lines that generates Table 1 are:
# Table 1
values = expand.grid(
list(
Methods = c('pcalg_custom','ccdr_paper_t','partial2','pcalg_addBG2',
'partial2_t',
'pcalg_addBG2_t','lingam_custom','pcalg_custom_par','pcalg_custom_stable'),
nlambda = c(30),
Btypes = c('genB_mult_Yeast1','genB_mult_Yeast2','genB_mult_Yeast3',
'genB_mult_Ecoli1','genB_mult_Ecoli2'),
Ns = c(40,50,100,200),
Seeds = 1:10,
m = c(2),
m1 = c(25)), stringsAsFactors = FALSE)
table1 = mcmapply(get_metrics_by_method, method=values$Methods, nlambda=values$nlambda, Btype=values$Btypes, n=values$Ns, seed=values$Seeds, m=values$m, m1=values$m1,
mc.cores=ncores)
The Python version and related code is available at https://github.com/shr264/pyPDAG.
Syed Rahman