Coder Social home page Coder Social logo

tpc's Introduction

tPC - Causal discovery with temporal background knowledge

This package implements the tPC algorithm for causal discovery. The 't' stands for 'temporal' or 'tiers' and indicates that background knowledge in the form of a partial node/variable ordering is available. Our implementation is a modified version of pc from the pcalg package (Kalisch et al. 2012) with the following additional options:

Using the tiers argument, the user can allocate each node/variable to a tier. Specifying tiers has two effects: First, conditional independence testing is restricted such that the variables in the conditioning set do not lie in the future of the variables whose independence is being tested. This reduces the number of unnecessary conditional independence tests and thus makes the algorithm more reliable. Second, edges between nodes in different tiers are oriented from the earlier tier to the later tier. This usually results in a more informative output. Both modifications were suggested in Spirtes et al. (2000), p. 93.

Additionally, further directed edges may be blacklisted using the forbEdges argument. In contrast to pcalg, this allows the user to forbid one direction of an edge, but allow the other one. The arguments context.all and context.tier function as whitelists. Variables in context.all are glocal context variables; as such, they are parents of all other non-context nodes in the graphs (examples are variables encoding batch effect in gene expression data, or 'sex' and 'country' in a cohort study). Variables in context.tier are tier-specific context variables, which are parents of all non-context nodes in the same tier (e.g. 'calender year' if the tiers encode different years).

The package also includes a function called ida_invalid, which determines possibly valid adjustment sets from a graph that is not a valid CPDAG or MPDAG.

Installation

Install graph and RBGL from Bioconductor and devtools from CRAN, and make sure that Rtools40 is installed on your computer. Then run the following commands:

devtools::install_github("bips-hb/tpc")
library(tpc)

References

Markus Kalisch, Martin Maechler, Diego Colombo, Marloes H. Maathuis, Peter Buehlmann (2012). Causal Inference Using Graphical Models with the R Package pcalg. Journal of Statistical Software, 47(11), 1-26. URL https://www.jstatsoft.org/article/view/v047i11.

Peter Spirtes, Clark Glymour, Richard Scheines (2000). Causation, Prediction, and Search. Second Edition. MIT Press, Cambridge, Massachusetts, USA.

tpc's People

Contributors

jawitte avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.