Learn R Programming

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

pcalg (version 2.6-12)

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,575

Version

2.6-12

License

GPL (>= 2)

Maintainer

Markus Kalisch

Last Published

September 22nd, 2020

Functions in pcalg (2.6-12)

GaussParDAG-class

Class "GaussParDAG" of Gaussian Causal Models
LINGAM

Linear non-Gaussian Acyclic Models (LiNGAM)
beta.special

Compute set of intervention effects
disCItest

G square Test for (Conditional) Independence of Discrete Variables
dreach

Compute D-SEP(x,y,G)
ParDAG-class

Class "ParDAG" of Parametric Causal Models
gmB

Graphical Model 5-Dim Binary Example Data
beta.special.pcObj

Compute set of intervention effects in a fast way
corGraph

Computing the correlation graph
gies

Estimate Interventional Markov Equivalence Class of a DAG by GIES
dag2cpdag

Convert a DAG to a CPDAG
find.unsh.triple

Find all Unshielded Triples in an Undirected Graph
fciPlus

Estimate a PAG by the FCI+ Algorithm
binCItest

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

Graphical Model 7-dim IDA Data Examples
checkTriple

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

Class "EssGraph"
getGraph

Get the "graph" Part or Aspect of R Object
GaussL0penIntScore-class

Class "GaussL0penIntScore"
legal.path

Check if a 3-node-path is Legal
getNextSet

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

Graphical Model 8-Dimensional Interventional Gaussian Example Data
pcalg2dagitty

Transform the adjacency matrix from pcalg into a dagitty object
optAdjSet

Compute the optimal adjustment set
showAmat

Show Adjacency Matrix of pcAlgo object
udag2pag

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

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

Compute Structural Hamming Distance (SHD)
pcalg-internal

Internal Pcalg Functions
udag2apag

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

Virtual Class "Score"
fciAlgo-class

Class "fciAlgo" of FCI Algorithm Results
fci

Estimate a PAG by the FCI Algorithm
plotSG

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

Generate a Directed Acyclic Graph (DAG) randomly
plotAG

Plot partial ancestral graphs (PAG)
pc

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

Add background knowledge to a CPDAG or PDAG
gds

Greedy DAG Search to Estimate Markov Equivalence Class of DAG
adjustment

Compute adjustment sets for covariate adjustment.
pc.cons.intern

Utility for conservative and majority rule in PC and FCI
compareGraphs

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

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

Estimate an RFCI-PAG using the RFCI Algorithm
dsepTest

Test for d-separation in a DAG
dsep

Test for d-separation in a DAG
condIndFisherZ

Test Conditional Independence of Gaussians via Fisher's Z
ges

Estimate the Markov equivalence class of a DAG using GES
showEdgeList

Show Edge List of pcAlgo object
simy

Estimate Interventional Markov Equivalence Class of a DAG
idaFast

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

Estimate Final Skeleton in the FCI algorithm
pdag2dag

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

Plotting a pcAlgo object using the package igraph
pcSelect

PC-Select: Estimate subgraph around a response variable
pcSelect.presel

Estimate Subgraph around a Response Variable using Preselection
amatType

Types and Display of Adjacency Matrices in Package 'pcalg'
gAlgo-class

Class "gAlgo"
backdoor

Find Set Satisfying the Generalized Backdoor Criterion (GBC)
dag2essgraph

Convert a DAG to an Essential Graph
possibleDe

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

Convert a DAG with latent variables into a PAG
qreach

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

Graphical Model 8-Dimensional Gaussian Example Data
gmD

Graphical Model Discrete 5-Dim Example Data
wgtMatrix

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

Latent Variable 4-Dim Graphical Model Data Example
isValidGraph

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

Test If Set Satisfies Generalized Adjustment Criterion (GAC)
ida

Estimate Multiset of Possible Joint Total Causal Effects
jointIda

Estimate Multiset of Possible Total Joint Effects
pcAlgo-class

Class "pcAlgo" of PC Algorithm Results, incl. Skeleton
opt.target

Get an optimal intervention target
mcor

Compute (Large) Correlation Matrix
rmvnorm.ivent

Simulate from a Gaussian Causal Model
visibleEdge

Check visible edge.
possDe

Find possible descendants of given node(s).
possAn

Find possible ancestors of given node(s).
pcAlgo

PC-Algorithm [OLD]: Estimate Skeleton or Equivalence Class of a DAG
pcorOrder

Compute Partial Correlations
rmvDAG

Generate Multivariate Data according to a DAG
udag2pdag

Last PC Algorithm Step: Extend Object with Skeleton to Completed PDAG
pdag2allDags

Enumerate All DAGs in a Markov Equivalence Class
r.gauss.pardag

Generate a Gaussian Causal Model Randomly
trueCov

Covariance matrix of a DAG.
skeleton

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

Random DAG Generation
GaussL0penObsScore-class

Class "GaussL0penObsScore"
mat2targets

Conversion between an intervention matrix and a list of intervention targets