Package: pcalg 2.7-12

Markus Kalisch

pcalg: Methods for Graphical Models and Causal Inference

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.

Authors:Markus Kalisch [aut, cre], Alain Hauser [aut], Martin Maechler [aut], Diego Colombo [ctb], Doris Entner [ctb], Patrik Hoyer [ctb], Antti Hyttinen [ctb], Jonas Peters [ctb], Nicoletta Andri [ctb], Emilija Perkovic [ctb], Preetam Nandy [ctb], Philipp Ruetimann [ctb], Daniel Stekhoven [ctb], Manuel Schuerch [ctb], Marco Eigenmann [ctb], Leonard Henckel [ctb], Joris Mooij [ctb]

pcalg_2.7-12.tar.gz
pcalg_2.7-12.tar.gz(r-4.5-noble)pcalg_2.7-12.tar.gz(r-4.4-noble)
pcalg_2.7-12.tgz(r-4.4-emscripten)pcalg_2.7-12.tgz(r-4.3-emscripten)
pcalg.pdf |pcalg.html
pcalg/json (API)
NEWS

# Install 'pcalg' in R:
install.packages('pcalg', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://r-forge.r-project.org/projects/pcalg

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:
  • gmB - Graphical Model 5-Dim Binary Example Data
  • gmD - Graphical Model Discrete 5-Dim Example Data
  • gmG - Graphical Model 8-Dimensional Gaussian Example Data
  • gmG8 - Graphical Model 8-Dimensional Gaussian Example Data
  • gmI - Graphical Model 7-dim IDA Data Examples
  • gmI7 - Graphical Model 7-dim IDA Data Examples
  • gmInt - Graphical Model 8-Dimensional Interventional Gaussian Example Data
  • gmL - Latent Variable 4-Dim Graphical Model Data Example

9.75 score 34 stars 19 packages 668 scripts 14k downloads 24 mentions 95 exports 34 dependencies

Last updated 3 months agofrom:930fe47687. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKNov 12 2024
R-4.5-linux-x86_64OKNov 12 2024

Exports:addBgKnowledgeadjustmentagesallDagsamat2dagbackdoorbeta.specialbeta.special.pcObjbinCItestcausalEffectcheckTriplecompareGraphscondIndFisherZcorGraphdag2cpdagdag2essgraphdag2pagdisCItestdreachdsepdsepAMdsepAMTestdsepTestfcifciPlusfind.unsh.triplegacgaussCItestgdsgesgetGraphgetNextSetgiesgSquareBingSquareDisidaidaFastiplotPCisValidGraphjointIdalegal.pathlingamLINGAMmat2targetsmcoropt.targetoptAdjSetpag2ancpag2confpag2edgepag2magAMpcpc.cons.internpcalg2dagittypcAlgopcAlgo.PerfectpcorOrderpcSelectpcSelect.preselpdag2allDagspdag2dagpdsepplotplotAGplotSGpossAnpossDepossibleDeqreachr.gauss.pardagrandDAGrandomDAGrfcirfci.vStrucrmvDAGrmvnorm.iventsearchAMshdshowshowAmatshowEdgeListsimyskeletonsummarytargets2mattriple2numbtrueCovudag2apagudag2pagudag2pdagudag2pdagRelaxedudag2pdagSpecialvisibleEdgewgtMatrixzStat

Dependencies:abindbdsmatrixBHBiocGenericsBiocManagercliclueclustercolorspacecorpcorcpp11DEoptimRfastICAgenericsggmgluegraphigraphlatticelifecyclelmtestmagrittrMASSMatrixpkgconfigRBGLRcppRcppArmadillorlangrobustbasesfsmiscvcdvctrszoo

Overview of the 'pcalg' Package for R

Rendered fromvignette2018.Rnwusingutils::Sweaveon Nov 12 2024.

Last update: 2024-02-07
Started: 2018-06-04

Readme and manuals

Help Manual

Help pageTopics
Add background knowledge to a CPDAG or PDAGaddBgKnowledge
Compute adjustment sets for covariate adjustment.adjustment
Estimate an APDAG within the Markov equivalence class of a DAG using AGESages
Types and Display of Adjacency Matrices in Package 'pcalg'amat.cpdag amat.pag amatType coerce,fciAlgo,amat-method coerce,fciAlgo,matrix-method coerce,LINGAM,amat-method coerce,pcAlgo,amat-method coerce,pcAlgo,matrix-method show.fci.amat show.pc.amat
Find Set Satisfying the Generalized Backdoor Criterion (GBC)backdoor
Compute set of intervention effectsbeta.special
Compute set of intervention effects in a fast waybeta.special.pcObj
G square Test for (Conditional) Independence of Binary VariablesbinCItest gSquareBin
Check Consistency of Conditional Independence for a Triple of NodescheckTriple
Compare two graphs in terms of TPR, FPR and TDRcompareGraphs
Test Conditional Independence of Gaussians via Fisher's ZcondIndFisherZ gaussCItest zStat
Computing the correlation graphcorGraph
Convert a DAG to a CPDAGdag2cpdag
Convert a DAG to an Essential Graphdag2essgraph
Convert a DAG with latent variables into a PAGdag2pag
G square Test for (Conditional) Independence of Discrete VariablesdisCItest gSquareDis
Compute D-SEP(x,y,G)dreach
Test for d-separation in a DAGdsep
Test for d-separation in a MAGdsepAM
Test for d-separation in a MAGdsepAMTest
Test for d-separation in a DAGdsepTest
Class '"EssGraph"'EssGraph-class plot,EssGraph,ANY-method
Estimate a PAG with the FCI Algorithmfci
Class "fciAlgo" of FCI Algorithm ResultsfciAlgo-class plot,fciAlgo,ANY-method print.fciAlgo show,fciAlgo-method summary,fciAlgo-method
Estimate a PAG with the FCI+ AlgorithmfciPlus
Find all Unshielded Triples in an Undirected Graphfind.unsh.triple
Test If Set Satisfies Generalized Adjustment Criterion (GAC)gac
Class '"gAlgo"'gAlgo-class
Class '"GaussL0penIntScore"'GaussL0penIntScore-class global.mle,GaussL0penIntScore-method global.score,GaussL0penIntScore-method local.mle,GaussL0penIntScore-method local.score,GaussL0penIntScore-method
Class '"GaussL0penObsScore"'GaussL0penObsScore-class global.mle,GaussL0penObsScore-method global.score,GaussL0penObsScore-method local.mle,GaussL0penObsScore-method local.score,GaussL0penObsScore-method
Class '"GaussParDAG"' of Gaussian Causal ModelsGaussParDAG-class
Greedy DAG Search to Estimate Markov Equivalence Class of DAGgds
Estimate the Markov equivalence class of a DAG using GESges
Get the "graph" Part or Aspect of R ObjectgetGraph getGraph,ANY-method getGraph,fciAlgo-method getGraph,matrix-method getGraph,pcAlgo-method getGraph-methods
Iteration through a list of all combinations of choose(n,k)getNextSet
Estimate Interventional Markov Equivalence Class of a DAG by GIESgies
Graphical Model 5-Dim Binary Example DatagmB
Graphical Model Discrete 5-Dim Example DatagmD
Graphical Model 8-Dimensional Gaussian Example DatagmG gmG8
Graphical Model 7-dim IDA Data ExamplesgmI gmI7
Graphical Model 8-Dimensional Interventional Gaussian Example DatagmInt
Latent Variable 4-Dim Graphical Model Data ExamplegmL
Estimate Multiset of Possible Joint Total Causal EffectscausalEffect ida
Multiset of Possible Total Causal Effects for Several Target Var.sidaFast
Plotting a pcAlgo object using the package igraphiplotPC
Check for a DAG, CPDAG or a maximally oriented PDAGisValidGraph
Estimate Multiset of Possible Total Joint EffectsjointIda
Check if a 3-node-path is Legallegal.path
Linear non-Gaussian Acyclic Models (LiNGAM)LINGAM lingam
Conversion between an intervention matrix and a list of intervention targetsmat2targets targets2mat
Compute (Large) Correlation Matrixmcor
Get an optimal intervention targetopt.target
Compute the optimal adjustment setoptAdjSet
Reads off identifiable ancestors and non-ancestors from a directed PAGpag2anc
Reads off identifiable unconfounded node pairs from a directed PAGpag2conf
Reads off identifiable parents and non-parents from a directed PAGpag2edge
Transform a PAG into a MAG in the Corresponding Markov Equivalence Classpag2magAM
Class '"ParDAG"' of Parametric Causal ModelsParDAG-class plot,ParDAG,ANY-method
Estimate the Equivalence Class of a DAG using the PC Algorithmpc
Utility for conservative and majority rule in PC and FCIpc.cons.intern triple2numb
Transform the adjacency matrix from 'pcalg' into a 'dagitty' objectpcalg2dagitty
PC-Algorithm [OLD]: Estimate Skeleton or Equivalence Class of a DAGpcAlgo pcAlgo.Perfect
Class "pcAlgo" of PC Algorithm Results, incl. SkeletonpcAlgo-class plot,pcAlgo,ANY-method print.pcAlgo show,pcAlgo-method summary,pcAlgo-method
Compute Partial CorrelationspcorOrder
PC-Select: Estimate subgraph around a response variablepcSelect
Estimate Subgraph around a Response Variable using PreselectionpcSelect.presel
Enumerate All DAGs in a Markov Equivalence Classpdag2allDags
Extend a Partially Directed Acyclic Graph (PDAG) to a DAGpdag2dag
Estimate Final Skeleton in the FCI algorithmpdsep
Plot partial ancestral graphs (PAG)plotAG
Plot the subgraph around a Specific Node in a Graph ObjectplotSG
Find possible ancestors of given node(s).possAn
Find possible descendants of given node(s).possDe
[DEPRECATED] Find possible descendants on definite status paths.possibleDe
Compute Possible-D-SEP(x,G) of a node x in a PDAG Gqreach
Generate a Gaussian Causal Model Randomlyr.gauss.pardag
Random DAG GenerationrandDAG
Generate a Directed Acyclic Graph (DAG) randomlyrandomDAG
Estimate an RFCI-PAG using the RFCI Algorithmrfci
Generate Multivariate Data according to a DAGrmvDAG
Simulate from a Gaussian Causal Modelrmvnorm.ivent
Virtual Class "Score"Score-class
Search for certain nodes in a DAG/CPDAG/MAG/PAGsearchAM
Compute Structural Hamming Distance (SHD)shd
Show Adjacency Matrix of pcAlgo objectshowAmat
Show Edge List of pcAlgo objectshowEdgeList
Estimate Interventional Markov Equivalence Class of a DAGsimy
Estimate (Initial) Skeleton of a DAG using the PC / PC-Stable Algorithmskeleton
Covariance matrix of a DAG.trueCov
Last step of RFCI algorithm: Transform partially oriented graph into RFCI-PAGudag2apag
Last steps of FCI algorithm: Transform Final Skeleton into FCI-PAGudag2pag
Last PC Algorithm Step: Extend Object with Skeleton to Completed PDAGudag2pdag udag2pdagRelaxed udag2pdagSpecial
Check visible edge.visibleEdge
Weight Matrix of a Graph, e.g., a simulated DAGwgtMatrix