Description Usage Arguments Value Examples
This is the parallelised version of the pcSelect (stable) function in the pcalg package. Assume that we have a fixed target variable, the algorithm will test the dependency between each variable and the target variable conditioning on combinations of other variables.
1 2 3 | pcSelect_parallel(y, dm, method = c("parallel"), mem.efficient = FALSE,
num_workers, alpha, corMethod = "standard", verbose = FALSE,
directed = FALSE)
|
y |
The target (response) variable. |
dm |
Data matrix with rows are samples and columns are variables. |
method |
Character string specifying method; the default, "parallel" provides an parallelised method to implement all the conditional independence tests. |
mem.efficient |
If TRUE, uses less amount of memory at any time point while running the algorithm |
num_workers |
The numbers of cores CPU to run the algorithm |
alpha |
Significance level of individual partial correlation tests. |
corMethod |
"standard" or "Qn" for standard or robust correlation estimation |
verbose |
Logical or in {0,1,2}; FALSE, 0: No output, TRUE, 1: Little output, 2: Detailed output. Note that such output makes the function very much slower. |
directed |
Logical; should the output graph be directed? |
G A logical vector indicating which column of dm is associated with y.
zMin The minimal z-values when testing partial correlations between y and each column of dm. The larger the number, the more consistent is the edge with the data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##########################################
## Using pcSelect_parallel without mem.efficeient
##########################################
library(pcalg)
library(parallel)
p <- 10
set.seed(101)
myDAG <- randomDAG(p, prob = 0.2)
n <- 1000
d.mat <- rmvDAG(n, myDAG, errDist = "normal")
pcSelect_parallel(d.mat[,10],d.mat[,-10], alpha=0.05,num_workers=2)
##########################################
## Using pcSelelct_parallel with mem.efficeient
##########################################
library(pcalg)
library(parallel)
p <- 10
set.seed(101)
myDAG <- randomDAG(p, prob = 0.2)
n <- 1000
d.mat <- rmvDAG(n, myDAG, errDist = "normal")
pcSelect_parallel(d.mat[,10],d.mat[,-10], alpha=0.05,mem.efficient=TRUE,num_workers=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.