boot.skeleton: Peter & Clark Skeleton Algorithm With Bootstrapping

Description Usage Arguments Examples

View source: R/algorithms.R

Description

This function allows you to learn a directed graph from a dataset using the Peter & Clark skeleton algorithm (stable version).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
boot.skeleton(
  df,
  whitelist = NULL,
  blacklist = NULL,
  alpha = 0.01,
  max.sx = Inf,
  R = 200,
  m = NULL,
  threshold = 0.5,
  to = c("igraph", "adjacency", "edges", "graph", "bnlearn"),
  cluster = parallel::detectCores(),
  implementation = c("pcalg", "bnlearn"),
  pcalg.indep.test = pcalg::gaussCItest,
  pcalg.u2pd = c("relaxed", "rand", "retry"),
  pcalg.conservative = FALSE,
  pcalg.maj.rule = FALSE,
  pcalg.solve.confl = FALSE,
  bnlearn.test = ci.tests,
  bnlearn.B = NULL,
  seed = sample(1:10^6, 1)
)

Arguments

df

Dataset.

whitelist

A data frame with two columns, containing a set of arcs to be included in the graph (optional).

blacklist

A data frame with two columns, containing a set of arcs not to be included in the graph (optional).

alpha

Target nominal type I error rate. Default: 0.01

max.sx

Maximum allowed size of the conditioning sets.

R

Number of bootstrap replicates (optional). Default: 200

m

Size of training set (optional). Default: nrow(df)/2

threshold

Minimum strength required for a coefficient to be included in the average adjacency matrix (optional). Default: 0.5

to

Output format ('adjacency', 'edges', 'graph', 'igraph', or 'bnlearn') (optional).

cluster

A cluster object from package parallel or the number of cores to be used (optional). Default: parallel::detectCores()

implementation

Peter & Clark algorithm implementation: 'pcalg' or 'bnlearn'. Default: 'pcalg'

pcalg.indep.test

Conditional independence test to be used (pcalg implementation). Default: pcalg::gaussCItest

bnlearn.test

Conditional independence test to be used (bnlearn implementation): 'cor', 'mc-cor', 'smc-cor', 'zf', 'mc-zf', 'smc-zf', 'mi-g', 'mc-mi-g', 'smc-mi-g', or 'mi-g-sh'. Default: 'cor'

bnlearn.B

Number of permutations considered for each permutation test (bnlearn implementation).

seed

Seed used for random selection. Default: NULL

Examples

1
2
3
4
obj <- boot.skeleton(df, implementation='pcalg')
obj <- boot.skeleton(df, implementation='bnlearn')
avg.g <- obj$average
g.rep <- obj$replicates

rlebron-bioinfo/gnlearn documentation built on July 25, 2020, 12:38 p.m.