Git Product home page Git Product logo

spycause's Introduction

spycause

Documentation Status

A module for spatial causal inference in Python. Docs are forthcoming.

For the Python package used to run the simulation experiments in Hoffman and Kedron (2023), please see spycause-experiments.

The regression adjustments provided here address data settings with the following graph structure:

image

where $\pi(x, u) = P(Z = 1 \mid X = x, U = u)$ is the propensity score, $X$ is a set of observed confounders, and $U$ stands for all unobserved spatial confounders. $\pi$ is placed in a square node to indicate that it is not a random variable, and rather a deterministic function of random variables $X$ and $U$. We also provide adjustments to correct for spatial interference between locations (not depicted).

Features

  • Simulation code for spatially confounded or interfered data
  • Bayesian estimation routines (using Stan) for ordinary linear regression (OLS), conditional autoregressive models (CAR), and joint models for propensity score and outcome
  • Adjustments for spatial interference
  • Spatial and nonspatial first-stage propensity score estimation (also using Stan)

spycause's People

Contributors

tdhoffman avatar

Stargazers

 avatar Demetrios Papakostas avatar Mikael Brunila avatar

Watchers

 avatar

Forkers

ljwolf

spycause's Issues

Clean repo

  • remove comments
  • blacken/format repo
  • migrate tests to tutorials and create tests (spawning separate todo)
  • remove/export extraneous files

Develop unit tests

  • add action to run tests on commit
  • add badge for tests in README
  • CARSimulator
    • __init__ with various data
    • simulate
    • pathological cases
  • OLS
    • fit
    • fit with interference adj
    • predict
    • score
    • waic
    • diagnostics
  • ICAR
    • fit
    • fit with interference adj
    • predict
    • score
    • waic
    • diagnostics
  • CAR
    • fit
    • fit with interference adj
    • predict
    • score
    • waic
    • diagnostics
  • Joint
    • fit
    • fit with interference adj
    • predict
    • score
    • waic
    • diagnostics
  • InterferenceAdj
    • transform
    • pathological cases
  • PropEst
    • nonspatial: fit, transform, and fit_transform
    • spatial: fit, transform, and fit_transform
    • pathological cases

Add tutorialization

  • create notebooks folder

develop notebooks for:

  • simulation code
  • all models (workflow demonstration)

Finish documentation

  • autodoc all the models (gotta figure out sphinx for this)
  • write descriptions for all the models
  • document preprocessing.py
    • explain interference adjustments
    • explain prop score pre-estimation
  • landing page that directs to tutorials
  • style and formatting ๐ŸŽจโœจ

Models don't work in sklearn pipelines

Since the .fit() methods of all the models accept the treatment variable separately, the sklearn.pipeline.Pipeline class won't allow for one of these models to be the final estimator in a pipeline. Will likely need to violate some aspect of sklearn's style guide in order to admit two different kinds of covariates (confounders and treatment).

Host as a package

  • configure metadata
  • configure pyproject.toml
  • create license
  • upload to pip
  • make a tweet about it (after finishing tutorials and docs)
  • upload to conda

Add more models

  • finish SpatialIV
  • polish ICAR
  • add geographic regression discontinuity design
  • add spatial diff-in-diff
  • add nonlinear GP or regression tree method?
  • others....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.