causal-discovery

Infers causal DAGs, CPDAGs, or PAGs from observational data via structure learning.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Yuuqq/claude-social-science-skills --skill causal-discovery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: causal-discovery
Source: https://github.com/Yuuqq/claude-social-science-skills/tree/main/social-science-skills/causal-discovery
Command: npx skills add https://github.com/Yuuqq/claude-social-science-skills --skill causal-discovery

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, causal-learn, networkx, matplotlib, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps you infer a causal structure (DAG/PAG) from observational data so you can form testable causal hypotheses when experiments are not available.

Core Features & Use Cases

  • Causal structure learning from data: Learn conditional-independence-based and score-based graph structures to support social science causal modeling.
  • Handles latent confounding when needed: Use FCI to produce a Partial Ancestral Graph (PAG) when hidden common causes are plausible.
  • Practical method selection guidance: Choose among PC, FCI, GES, and time-series-oriented options based on your data type and assumptions (cross-sectional vs. time series; sufficiency vs. latent confounding).

Quick Start

Run a DAG-structure discovery workflow on your observational dataset and return a discovered graph along with assumptions, method choice rationale, and evaluation notes.

Frequently Asked Questions about causal-discovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I learn a causal graph from observational data?

To learn a causal graph from observational data, use constraint-based or score-based structure learning algorithms like PC, GES, or LiNGAM. These methods infer DAGs or CPDAGs by testing conditional independence relationships within your dataset.

When do I need a Partial Ancestral Graph for causal discovery?

You need a Partial Ancestral Graph (PAG) for causal discovery when latent confounding is plausible. Using the FCI algorithm accounts for hidden common causes that standard PC or GES methods incorrectly assume away under causal sufficiency.

What is the best way to identify confounders and mediators in cross-sectional data?

The best way to identify confounders and mediators in cross-sectional data is applying causal structure learning algorithms to infer the causal structure, then analyzing the discovered graph edges to pinpoint likely confounding and mediating pathways.

Can I use causal-learn with pandas and numpy to test a theoretical DAG against empirical measurements?

Yes, you can use causal-learn with pandas and numpy to test a theoretical DAG against empirical measurements. The workflow applies conditional independence tests to validate whether your observed data actually supports the hypothesized causal structure.

Does causal structure learning work for non-Gaussian continuous data?

Yes, causal structure learning works for non-Gaussian continuous data by using the LiNGAM algorithm. This method estimates a unique Directed Acyclic Graph (DAG) by leveraging non-Gaussianity assumptions instead of relying on standard Gaussian constraints.

What are the limitations of using PC vs FCI for social science causal modeling?

The limitation of using PC for social science causal modeling is its strict assumption of no unobserved confounders. FCI overcomes this by generating PAGs, but yields less interpretable graphs with circle edge marks indicating ambiguous causal directions.