Localized V2 rewrite for this language is in progress. Showing English-first content for now.
Science Workflow

Causal Inference

Intervention<T> and Counterfactual<T> types for first-class causal reasoning

Back to Science Hub

Causal Inference with Sounio

Sounio treats causality as a type-system concern. Intervention<T> and Counterfactual<T> are compiler-level types — not library conventions.

Causal DAG with Pearl’s do-operator

// Build a causal DAG with epistemic edge uncertainty
var dag = causal_dag_new()
dag = dag_add_node(dag, 0)  // treatment
dag = dag_add_node(dag, 1)  // outcome
dag = dag_add_edge(dag, 0, 1,
    ec_beta_new(8.0, 2.0), 0.5, 0.1)

// Pearl's do-operator removes confounding
let intervened = do_intervention(dag, 1)

Average Treatment Effect

// Estimate ATE with epistemic uncertainty
let ate = average_treatment_effect(dag, 0, 1)