RecursiveCausalDiscovery

Recursive causal discovery with Julia

https://github.com/sepehr78/recursivecausaldiscovery.jl

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.4%) to scientific vocabulary

Keywords

causal-discovery causal-discovery-methods causality
Last synced: 6 months ago · JSON representation ·

Repository

Recursive causal discovery with Julia

Basic Info
Statistics
  • Stars: 9
  • Watchers: 2
  • Forks: 0
  • Open Issues: 1
  • Releases: 2
Topics
causal-discovery causal-discovery-methods causality
Created about 2 years ago · Last pushed 10 months ago
Metadata Files
Readme License Citation

README.md

RecursiveCausalDiscovery.jl

A Julia implementation of Recursive Causal Discovery algorithms. Recursive Causal Discovery (RCD) is an efficient approach for causal discovery (i.e., learning a causal graph from data).

⚠️ This package is still under development! ⚠️

CI codecov

Overview

Comparison of RCD with the PC algorithm implemented in CausalInference.jl

The following plots show the F1 score (computed using true causal graph), and number of conditional independency (CI) tests done.

F1 score and #CI tests of RSL versus PC

Implemented algorithms

  • [x] Recursive Structure Learning (RSL)
    • [x] Learning v-structures
    • [x] Meek's rules
  • [ ] MArkov boundary-based Recursive Variable ELimination (MARVEL)
  • [ ] Latent MARVEL (L-MARVEL)
  • [ ] Removable Order Learning (ROL)

Installation

Requires at least Julia 1.10 julia julia> ]add RecursiveCausalDiscovery

How to use

The package so far has only one algorithm implemented: RSL-D, which can be called using the rsld function. The function takes the data matrix/table and a conditional independence test function as input, and returns the completed partially oriented directed acyclic graph (CPDAG) as output.

Simple example

In this example, a csv file named data.csv is loaded, and the RSL-D algorithm is used to learn the CPDAG. The conditional independence test is based on the Fisher's Z-test.

```julia using RecursiveCausalDiscovery using CSV using Tables

load data (columns are variables and rows are samples)

data = CSV.read("data.csv", Tables.matrix)

use a Gaussian conditional independence test

siglevel = 0.01 citest = (x, y, condvec, data) -> fisherz(x, y, condvec, data, siglevel)

learn the oriented causal graph using RSL

cpdag = rsld(data, ci_test) ```

See the examples/rslexamplewo_data.jl for a complete example.

Generating random data from DAG and learning from it

See the examples/rslexamplewo_data.jl for an example on how to generate a random DAG using the Erdos-Renyi model, generate random Gaussian data from it, and learning the CPDAG using RSL-D.

Citation

If you do use this package, please cite our work.

bibtex @article{JMLR:v26:24-0384, author = {Ehsan Mokhtarian and Sepehr Elahi and Sina Akbari and Negar Kiyavash}, title = {Recursive Causal Discovery}, journal = {Journal of Machine Learning Research}, year = {2025}, volume = {26}, number = {61}, pages = {1--65}, url = {http://jmlr.org/papers/v26/24-0384.html} }

Acknowledgement

Thanks to Felix Wechsler for helping me with Julia and pushing me to implement RCD in Julia.

Owner

  • Name: Sepehr
  • Login: sepehr78
  • Kind: user

EEE & Math undergrad student at Bilkent University. Researcher @Bilkent-CYBORG.

Citation (citation.cff)

cff-version: 1.2.0
title: Recursive Causal Discovery
message: 'If you use this code, please cite the following work.'
type: software
authors:
  - family-names: Mokhtarian
    given-names: Ehsan
  - family-names: Elahi
    given-names: Sepehr
  - family-names: Akbari
    given-names: Sina
  - family-names: Kiyavash
    given-names: Negar
identifiers:
  - type: url
    value: 'https://arxiv.org/abs/2403.09300'
    description: ArXiv link

GitHub Events

Total
  • Issues event: 1
  • Watch event: 2
  • Push event: 1
Last Year
  • Issues event: 1
  • Watch event: 2
  • Push event: 1

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
juliahub.com: RecursiveCausalDiscovery

Recursive causal discovery with Julia

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 3.2%
Downloads: 3.8%
Average: 7.8%
Dependent packages count: 16.3%
Last synced: 6 months ago

Dependencies

.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • codecov/codecov-action v4 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite