CausalELM.jl: extreme learning machines for causal inference

CausalELM.jl is a new package to estimate treatment effects by predicting counterfactuals and correcting for nonrandomization. CausalELM.jl enables the estimation of event study designs, G-Computation, doubly robust estimation, and CATE estimation via metalearners, all using extreme learning machines as the underlying machine learning model. All the learners find the best number of neurons for the extreme learning machine by performing cross validation on a subsequence of the range of neurons and using an extreme learning machine to predict validation loss for all other possible network sizes. Estimating causal effects can be done in two lines of code, as in the example below.

using CausalELM

# 1000 data points with 5 features in pre-event period
x0 = rand(1000, 5)

# Pre-event outcome
y0 = rand(1000)

# 200 data points in the post-event period
x1 = rand(200, 5)

# Pose-event outcome
y1 = rand(200)

# Instantiate an EventStudy struct
event_study = EventStudy(x0, y0, x1, y1)

estimatecausaleffect!(event_study)

summarize(event_study)

CausalELM.jl is available on the General Registry and does not have any dependencies outside the Julia standard library.

4 Likes