Description Usage Arguments Value References Examples
This is the parallelised version of the IDA (stable) algorithm in the pcalg package.
1 2 | IDA_parallel(datacsv, cause, effect, pcmethod, alpha, num.cores,
mem.efficient = FALSE)
|
datacsv |
The dataset in csv format. |
cause |
The number of integer positions of the cause variables in the dataset. |
effect |
The number of integer positions of the target variables in the dataset. |
pcmethod |
Character string specifying method; the default, "parallel", will use the parallelised method for learning the skeleton of the graph, see skeleton_parallel. |
alpha |
significance level (number in (0; 1) for the individual conditional independence tests. |
num.cores |
The numbers of cores CPU to run the algorithm |
mem.efficient |
If TRUE, uses less amount of memory at any time point while running the algorithm |
A matrix that shows the causal effects (minimum of all possible effects) of the causes (columns) on the effects (rows)
Marloes H Maathuis, Markus Kalisch, Peter Buhlmann, et al. Estimating high-dimensional intervention effects from observational data. The Annals of Statistics, 37(6A):3133-3164,2009.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ##########################################
## Using IDA_parallel without mem.efficeient
##########################################
library(bnlearn)
library(pcalg)
library(parallel)
data("gmI")
datacsv <- cov(gmI$x)
IDA_parallel(datacsv,1:2,3:4,"parallel",0.01, 2)
##########################################
## Using IDA_parallel with mem.efficeient
##########################################
library(bnlearn)
library(pcalg)
library(parallel)
data("gmI")
datacsv <- cov(gmI$x)
IDA_parallel(datacsv,1:2,3:4,"parallel",0.01, 2, TRUE)
|
Attaching package: 'bnlearn'
The following object is masked from 'package:stats':
sigma
Attaching package: 'pcalg'
The following objects are masked from 'package:bnlearn':
dsep, pdag2dag, shd, skeleton
n=7,p=7
Num CI Tests= 23 0 ,Total CI Tests= 23 ,Total Time= 0.133
[,1] [,2]
[1,] -0.5962528 0.6407872
[2,] -0.2720181 -0.1364605
sh: 1: egrep: Permission denied
n=7,p=7
Num CI Tests= 23 0 ,Total CI Tests= 23 ,Total Time= 0.001
[,1] [,2]
[1,] -0.5962528 0.6407872
[2,] -0.2720181 -0.1364605
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.