fci: Fast Causal Inference Algorithm (FCI)

Description Usage Arguments Examples

View source: R/algorithms.R

Description

This function allows you to learn a directed graph from a dataset using the Fast Causal Inference algorithm (stable version).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
fci(
  df,
  whitelist = NULL,
  blacklist = NULL,
  indep.test = pcalg::gaussCItest,
  alpha = 0.01,
  max.sx = Inf,
  pdsep.max = Inf,
  conservative = FALSE,
  maj.rule = FALSE,
  version = c("fci", "rfci", "fci.plus"),
  type = c("normal", "anytime", "adaptive"),
  rules = rep(TRUE, 10),
  doPdsep = TRUE,
  biCC = FALSE,
  m = NULL,
  to = c("igraph", "adjacency", "edges", "graph", "bnlearn"),
  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).

indep.test

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

alpha

Target nominal type I error rate. Default: 0.01

max.sx

Maximum allowed size of the conditioning sets.

pdsep.max

Maximum size of Possible-D-SEP for which subsets are considered as conditioning sets in the conditional independence tests.

conservative

Whether or not the conservative PC is used (pcalg implementation). Default: FALSE

maj.rule

Whether or not the triples shall be checked for ambiguity using a majority rule idea, which is less strict than the conservative PC algorithm (pcalg implementation). Default: FALSE

version

Version of FCI algorithm to be used: 'fci', 'rfci', or 'fci.plus'. Default: 'fci'

type

Type of FCI algorithm to be used: 'normal', 'anytime', or 'adaptive'. Default: 'normal'

rules

Logical vector of length 10 indicating which rules should be used when directing edges. Default: rep(TRUE,10)

doPdsep

If FALSE, Possible-D-SEP is not computed, so that the algorithm simplifies to the Modified PC algorithm of Spirtes, Glymour and Scheines (2000, p.84). Default: TRUE

biCC

If TRUE, only nodes on paths between nodes x and y are considered to be in Possible-D-SEP(x) when testing independence between x and y. Default: TRUE

m

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

to

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

seed

Seed used for random selection. Default: NULL

Examples

1
g <- fci(df)

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