zenna / CounterfactualFairness.jl

1 stars 1 forks source link

Causal discovery method that produces probabilistic causal graph #3

Closed zenna closed 3 years ago

zenna commented 3 years ago

Many of the causal discovery methods produce a model that (i) may be non-parametric, and (ii) does not specify the distributions on nodes. Neither of these properties are compatible with standard counterfactuals. Contingent on the completion of #1, we need to extend the discovery methods to produce either Ia) a fully specified probabilistic causal graph, or (ii) a distribution over fully specified probabilistic causal graphs.

mschauer commented 3 years ago

Sketch for a first procedure for causal discovery and transformation into a model according to #1:

Input: Empirical covariance and mean.

Step 1: Run the PC algorithm to obtain a directed graph. Error if not all edges are directed.

Step 2: Compute the conditional distributions of variables along edges by using closed form computations for Gaussians:

"""
    conditional((; μ=..., Σ=...), A, B, xB)
Conditional distribution of `X[i for i in A]` given
`X[i for i in B] == xB` if ``X ~ N(μ, Σ)``.
"""
function conditional(P, A, B, xB)
    Z = P.Σ[A,B]*inv(P.Σ[B,B])
    (; μ = P.μ[A] + Z*(xB - P.μ[B]), Σ = P.Σ[A,A] - Z*P.Σ[B,A])
end

Step 3: Feed the graph and the conditional distributions into model
mschauer commented 3 years ago

We considered this as bit secondary to the main track which which can wait so I removed the mile stone.