Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CausalPy logo and restructure docs contents #184

Merged
merged 1 commit into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ pyreverse -o png causalpy --output-directory img
```

Classes
![](img/classes.png)
![](docs/source/_static/classes.png)

Packages
![](img/packages.png)
![](docs/source/_static/packages.png)

---

Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# CausalPy
<div align="center">
<a href="https://github.com/pymc-labs/CausalPy"><img width="60%" src="docs/source/_static/logo.png"></a>
</div>

----

![Build](https://github.com/pymc-labs/CausalPy/workflows/ci/badge.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI version](https://badge.fury.io/py/CausalPy.svg)](https://badge.fury.io/py/CausalPy)
![GitHub Repo stars](https://img.shields.io/github/stars/pymc-labs/causalpy?style=social)
![Read the Docs](https://img.shields.io/readthedocs/causalpy)
![PyPI - Downloads](https://img.shields.io/pypi/dm/causalpy)
![Interrogate](img/interrogate_badge.svg)
![Interrogate](docs/source/_static/interrogate_badge.svg)
[![codecov](https://codecov.io/gh/pymc-labs/CausalPy/branch/main/graph/badge.svg?token=FDKNAY5CZ9)](https://codecov.io/gh/pymc-labs/CausalPy)

# CausalPy

A Python package focussing on causal inference in quasi-experimental settings. The package allows for sophisticated Bayesian model fitting methods to be used in addition to traditional OLS.

_**STATUS:** Feel free to explore and experiment with the repository, and we very much welcome feedback (via [Issues](https://github.com/pymc-labs/CausalPy/issues)). But be aware that this code is very alpha! Expect the codebase and API to change for a while, so it is not appropriate to rely on this package for in-production or research pipelines._
Expand Down Expand Up @@ -92,7 +98,7 @@ This is appropriate when you have multiple units, one of which is treated. You b

| Frequentist | Bayesian |
|--|--|
| ![](img/synthetic_control_skl.svg) | ![](img/synthetic_control_pymc.svg) |
| ![](docs/source/_static/synthetic_control_skl.svg) | ![](docs/source/_static/synthetic_control_pymc.svg) |

> The data (treated and untreated units), pre-treatment model fit, and counterfactual (i.e. the synthetic control) are plotted (top). The causal impact is shown as a blue shaded region. The Bayesian analysis shows shaded Bayesian credible regions of the model fit and counterfactual. Also shown is the causal impact (middle) and cumulative causal impact (bottom).

Expand All @@ -112,7 +118,7 @@ This is appropriate for non-equivalent group designs when you have a single pre

| Frequentist | Bayesian |
|--|--|
| coming soon | ![](img/anova_pymc.svg) |
| coming soon | ![](docs/source/_static/anova_pymc.svg) |

> The data from the control and treatment group are plotted, along with posterior predictive 94% credible intervals. The lower panel shows the estimated treatment effect.

Expand All @@ -131,7 +137,7 @@ Data is expected to be in the following form. Shown are just two units - one in

| Frequentist | Bayesian |
|--|--|
| ![](img/difference_in_differences_skl.svg) | ![](img/difference_in_differences_pymc.svg) |
| ![](docs/source/_static/difference_in_differences_skl.svg) | ![](docs/source/_static/difference_in_differences_pymc.svg) |

>The data, model fit, and counterfactual are plotted. Frequentist model fits result in points estimates, but the Bayesian analysis results in posterior distributions, represented by the violin plots. The causal impact is the difference between the counterfactual prediction (treated group, post treatment) and the observed values for the treated group, post treatment.

Expand All @@ -150,7 +156,7 @@ Regression discontinuity designs are used when treatment is applied to units acc

| Frequentist | Bayesian |
|--|--|
| ![](img/regression_discontinuity_skl.svg) | ![](img/regression_discontinuity_pymc.svg) |
| ![](docs/source/_static/regression_discontinuity_skl.svg) | ![](docs/source/_static/regression_discontinuity_pymc.svg) |

> The data, model fit, and counterfactual are plotted (top). Frequentist analysis shows the causal impact with the blue shaded region, but this is not shown in the Bayesian analysis to avoid a cluttered chart. Instead, the Bayesian analysis shows shaded Bayesian credible regions of the model fits. The Frequentist analysis visualises the point estimate of the causal impact, but the Bayesian analysis also plots the posterior distribution of the regression discontinuity effect (bottom).

Expand All @@ -173,7 +179,7 @@ Here are some general resources about causal inference:

## Support

<img src="img/pymc-labs-log.png" align="right" width="50%" />
<img src="docs/source/_static/pymc-labs-log.png" align="right" width="50%" />

This repository is supported by [PyMC Labs](https://www.pymc-labs.io).

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
SOURCEDIR = source
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added docs/source/_static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions docs/conf.py → docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
# TODO: version seems not to be displayed despite setting this to True
html_logo = "logo.png"
html_theme_options = {
"display_version": True,
"logo_only": True,
"display_version": False,
}

# -- Options for autodoc ----------------------------------------------------
Expand Down
File renamed without changes.
File renamed without changes.
19 changes: 10 additions & 9 deletions docs/index.rst → docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.. CausalPy documentation master file, created by
sphinx-quickstart on Mon Nov 14 18:28:13 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. image:: _static/logo.png
:width: 80 %
:align: center
:alt: CausalPy logo


CausalPy - causal inference for quasi-experiments
=================================================
Expand Down Expand Up @@ -75,7 +76,7 @@ Synthetic control

This is appropriate when you have multiple units, one of which is treated. You build a synthetic control as a weighted combination of the untreated units.

.. image:: ../img/synthetic_control_pymc.svg
.. image:: _static/synthetic_control_pymc.svg

Geographical Lift / Geolift
""""""""""""""""""""""""""""
Expand All @@ -86,28 +87,28 @@ ANCOVA

This is appropriate when you have a single pre and post intervention measurement and have a treament and a control group.

.. image:: ../img/anova_pymc.svg
.. image:: _static/anova_pymc.svg

Difference in differences
"""""""""""""""""""""""""

This is appropriate when you have pre and post intervention measurement(s) and have a treament and a control group.

.. image:: ../img/difference_in_differences_pymc.svg
.. image:: _static/difference_in_differences_pymc.svg

Regression discontinuity
""""""""""""""""""""""""

Regression discontinuity designs are used when treatment is applied to units according to a cutoff on a running variable, which is typically not time. By looking for the presence of a discontinuity at the precise point of the treatment cutoff then we can make causal claims about the potential impact of the treatment.

.. image:: ../img/regression_discontinuity_pymc.svg
.. image:: _static/regression_discontinuity_pymc.svg

Support
-------

This repository is supported by `PyMC Labs <https://www.pymc-labs.io>`_.

.. image:: ../img/pymc-labs-log.png
.. image:: _static/pymc-labs-log.png
:align: center
:target: https://www.pymc-labs.io
:scale: 50 %
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.