Skip to content

Commit 31cf8d7

Browse files
committed
[IV 212] added more write up and improved plot
Signed-off-by: Nathaniel <[email protected]>
1 parent 1bf4a74 commit 31cf8d7

File tree

4 files changed

+211
-18
lines changed

4 files changed

+211
-18
lines changed

causalpy/pymc_models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ def build_model(self, X, Z, y, t, coords, priors):
158158
)
159159
sd_dist = pm.HalfCauchy.dist(beta=priors["lkj_sd"], shape=2)
160160
chol, corr, sigmas = pm.LKJCholeskyCov(
161-
name="chol_cov", eta=priors["eta"], n=2, sd_dist=sd_dist
161+
name="chol_cov",
162+
eta=priors["eta"],
163+
n=2,
164+
sd_dist=sd_dist,
162165
)
163166
# compute and store the covariance matrix
164167
pm.Deterministic(name="cov", var=pt.dot(l=chol, r=chol.T))

docs/source/_static/iv_reg.png

9.81 KB
Loading

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Instrumental Variable Regression
113113
"""""""""""""""""""""""
114114
Instrumental Variable regression is an appropriate technique when you wish to estimate the treatment effect of some variable on another, but are concerned that the treatment variable is endogenous in the system of interest i.e. correlated with the errors. In this case an "instrument" variable can be used in a regression context to disentangle treatment effect due to the threat of confounding due to endogeneity.
115115

116-
.. image:: _static/iv_reg.svg
116+
.. image:: _static/iv_reg.png
117117

118118

119119
Support

docs/source/notebooks/iv_pymc.ipynb

Lines changed: 206 additions & 16 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)