Learn R Programming

⚠️There's a newer version (2.7-12) of this package.Take me there.

pcalg (version 2.7-11)

Methods for Graphical Models and Causal Inference

Description

Functions for causal structure learning and causal inference using graphical models. The main algorithms for causal structure learning are PC (for observational data without hidden variables), FCI and RFCI (for observational data with hidden variables), and GIES (for a mix of data from observational studies (i.e. observational data) and data from experiments involving interventions (i.e. interventional data) without hidden variables). For causal inference the IDA algorithm, the Generalized Backdoor Criterion (GBC), the Generalized Adjustment Criterion (GAC) and some related functions are implemented. Functions for incorporating background knowledge are provided.

Copy Link

Version

Install

install.packages('pcalg')

Monthly Downloads

1,927

Version

2.7-11

License

GPL (>= 2)

Maintainer

Markus Kalisch

Last Published

February 12th, 2024

Functions in pcalg (2.7-11)

EssGraph-class

Class "EssGraph"
GaussL0penObsScore-class

Class "GaussL0penObsScore"
Score-class

Virtual Class "Score"
compareGraphs

Compare two graphs in terms of TPR, FPR and TDR
adjustment

Compute adjustment sets for covariate adjustment.
GaussParDAG-class

Class "GaussParDAG" of Gaussian Causal Models
ages

Estimate an APDAG within the Markov equivalence class of a DAG using AGES
corGraph

Computing the correlation graph
ParDAG-class

Class "ParDAG" of Parametric Causal Models
beta.special

Compute set of intervention effects
GaussL0penIntScore-class

Class "GaussL0penIntScore"
condIndFisherZ

Test Conditional Independence of Gaussians via Fisher's Z
dag2cpdag

Convert a DAG to a CPDAG
dag2essgraph

Convert a DAG to an Essential Graph
disCItest

G square Test for (Conditional) Independence of Discrete Variables
beta.special.pcObj

Compute set of intervention effects in a fast way
fci

Estimate a PAG with the FCI Algorithm
addBgKnowledge

Add background knowledge to a CPDAG or PDAG
dsep

Test for d-separation in a DAG
amatType

Types and Display of Adjacency Matrices in Package 'pcalg'
binCItest

G square Test for (Conditional) Independence of Binary Variables
dag2pag

Convert a DAG with latent variables into a PAG
checkTriple

Check Consistency of Conditional Independence for a Triple of Nodes
fciAlgo-class

Class "fciAlgo" of FCI Algorithm Results
gAlgo-class

Class "gAlgo"
dsepAM

Test for d-separation in a MAG
getGraph

Get the "graph" Part or Aspect of R Object
getNextSet

Iteration through a list of all combinations of choose(n,k)
dreach

Compute D-SEP(x,y,G)
gds

Greedy DAG Search to Estimate Markov Equivalence Class of DAG
fciPlus

Estimate a PAG with the FCI+ Algorithm
gac

Test If Set Satisfies Generalized Adjustment Criterion (GAC)
ges

Estimate the Markov equivalence class of a DAG using GES
gmI

Graphical Model 7-dim IDA Data Examples
backdoor

Find Set Satisfying the Generalized Backdoor Criterion (GBC)
gmInt

Graphical Model 8-Dimensional Interventional Gaussian Example Data
gies

Estimate Interventional Markov Equivalence Class of a DAG by GIES
find.unsh.triple

Find all Unshielded Triples in an Undirected Graph
gmB

Graphical Model 5-Dim Binary Example Data
gmL

Latent Variable 4-Dim Graphical Model Data Example
pag2conf

Reads off identifiable unconfounded node pairs from a directed PAG
ida

Estimate Multiset of Possible Joint Total Causal Effects
optAdjSet

Compute the optimal adjustment set
pag2anc

Reads off identifiable ancestors and non-ancestors from a directed PAG
dsepAMTest

Test for d-separation in a MAG
dsepTest

Test for d-separation in a DAG
isValidGraph

Check for a DAG, CPDAG or a maximally oriented PDAG
pcalg2dagitty

Transform the adjacency matrix from pcalg into a dagitty object
pcorOrder

Compute Partial Correlations
qreach

Compute Possible-D-SEP(x,G) of a node x in a PDAG G
jointIda

Estimate Multiset of Possible Total Joint Effects
gmD

Graphical Model Discrete 5-Dim Example Data
pag2edge

Reads off identifiable parents and non-parents from a directed PAG
randDAG

Random DAG Generation
idaFast

Multiset of Possible Total Causal Effects for Several Target Var.s
gmG

Graphical Model 8-Dimensional Gaussian Example Data
r.gauss.pardag

Generate a Gaussian Causal Model Randomly
mcor

Compute (Large) Correlation Matrix
iplotPC

Plotting a pcAlgo object using the package igraph
randomDAG

Generate a Directed Acyclic Graph (DAG) randomly
opt.target

Get an optimal intervention target
pdag2allDags

Enumerate All DAGs in a Markov Equivalence Class
rmvnorm.ivent

Simulate from a Gaussian Causal Model
pdag2dag

Extend a Partially Directed Acyclic Graph (PDAG) to a DAG
showEdgeList

Show Edge List of pcAlgo object
pdsep

Estimate Final Skeleton in the FCI algorithm
simy

Estimate Interventional Markov Equivalence Class of a DAG
pcSelect.presel

Estimate Subgraph around a Response Variable using Preselection
searchAM

Search for certain nodes in a DAG/CPDAG/MAG/PAG
udag2pdag

Last PC Algorithm Step: Extend Object with Skeleton to Completed PDAG
pcalg-internal

Internal Pcalg Functions
legal.path

Check if a 3-node-path is Legal
mat2targets

Conversion between an intervention matrix and a list of intervention targets
plotAG

Plot partial ancestral graphs (PAG)
visibleEdge

Check visible edge.
pag2mag

Transform a PAG into a MAG in the Corresponding Markov Equivalence Class
plotSG

Plot the subgraph around a Specific Node in a Graph Object
rfci

Estimate an RFCI-PAG using the RFCI Algorithm
rmvDAG

Generate Multivariate Data according to a DAG
pc

Estimate the Equivalence Class of a DAG using the PC Algorithm
pcAlgo

PC-Algorithm [OLD]: Estimate Skeleton or Equivalence Class of a DAG
pc.cons.intern

Utility for conservative and majority rule in PC and FCI
pcAlgo-class

Class "pcAlgo" of PC Algorithm Results, incl. Skeleton
possDe

Find possible descendants of given node(s).
possibleDe

[DEPRECATED] Find possible descendants on definite status paths.
shd

Compute Structural Hamming Distance (SHD)
wgtMatrix

Weight Matrix of a Graph, e.g., a simulated DAG
pcSelect

PC-Select: Estimate subgraph around a response variable
possAn

Find possible ancestors of given node(s).
showAmat

Show Adjacency Matrix of pcAlgo object
udag2apag

Last step of RFCI algorithm: Transform partially oriented graph into RFCI-PAG
skeleton

Estimate (Initial) Skeleton of a DAG using the PC / PC-Stable Algorithm
trueCov

Covariance matrix of a DAG.
udag2pag

Last steps of FCI algorithm: Transform Final Skeleton into FCI-PAG
LINGAM

Linear non-Gaussian Acyclic Models (LiNGAM)