Learn R Programming

pcalg (version 1.1-4)

rfci: Estimate the equivalence class of a MAG (PAG) using the RFCI Algorithm

Description

Estimate the RFCI-PAG from observational data, using the RFCI-algorithm.

Usage

rfci(suffStat, indepTest, p, alpha, verbose = FALSE, fixedGaps = NULL,
    fixedEdges = NULL, NAdelete = TRUE, m.max = Inf)

Arguments

suffStat
Sufficient statistics: List containing all necessary elements for the conditional independence decisions in the function indepTest.
indepTest
Predefined function for testing conditional independence. The function is internally called as indepTest(x,y,S,suffStat), and tests conditional independence of x and y given S. Here, x<
p
Number of variables.
alpha
Significance level for the individual conditional independence tests.
verbose
If TRUE, detailed output is provided.
fixedGaps
A logical matrix of dimension p*p. If entry [i,j] or [j,i] (or both) are TRUE, the edge i-j is removed before starting the algorithm. Therefore, this edge is guaranteed to be absent in the resulting graph.
fixedEdges
A logical matrix of dimension p*p. If entry [i,j] or [j,i] (or both) are TRUE, the edge i-j is never considered for removal. Therefore, this edge is guaranteed to be present in the resulting graph.
NAdelete
If indepTest returns NA and this option is TRUE, the corresponding edge is deleted. If this option is FALSE, the edge is not deleted.
m.max
Maximal size of the conditioning sets that are considered in the conditional independence tests.

Value

  • An object of class fciAlgo (see fciAlgo) containing the estimated graph (in the form of an adjacency matrix with various possible edge marks), the conditioning sets that lead to edge removals (sepset) and several other parameters.

Details

This function is rather similar to fci. However, it does not compute any possible d-sep sets and thus does not make tests conditioning on them. This makes RFCI much faster than FCI. The orientation rules for v-structures and rule 4 were modified in order to produce a PAG which, in the oracle version, is guaranteed to have the correct ancestral relationships.

References

Diego Colombo, Marloes H. Maathuis, Markus Kalisch, Thomas S. Richardson (2011). Learning high-dimensional DAGs with latent and selection variables. Arxiv, http://arxiv.org/abs/1104.5617

See Also

fci for estimating a PAG using the FCI algorithm; skeleton for estimating a skeleton using the PC algorithm; pc for estimating a CPDAG using the PC algorithm; gaussCItest, disCItest, binCItest and dsepTest as examples for indepTest.

Examples

Run this code
##################################################
## Example without latent variables
##################################################

set.seed(42)
p <- 7
## generate and draw random DAG :
myDAG <- randomDAG(p, prob = 0.4)
amat <- wgtMatrix(myDAG)
amat[amat!=0] <- 1
amat <- amat + t(amat)
amat[amat!=0] <- 1

myCPDAG <- dag2cpdag(myDAG)
amat2 <- t(wgtMatrix(myCPDAG))

mycor <- cov2cor(trueCov(myDAG))

## find skeleton and CPDAG using the RFCI algorithm
suffStat <- list(C = cov2cor(trueCov(myDAG)), n = 10^9)
indepTest <- gaussCItest
res <- rfci(suffStat, indepTest, p, alpha = 0.99, verbose=TRUE)

Run the code above in your browser using DataLab