From 362727b64d103a8b48ea96731b5e113cc1c78ad9 Mon Sep 17 00:00:00 2001 From: "Benjamin T. Vincent" Date: Tue, 4 Jul 2023 19:57:46 +0100 Subject: [PATCH 1/2] mutilation -> mutation --- .../interventional_distribution.ipynb | 35 ++++++++++++++++++- .../interventional_distribution.myst.md | 2 +- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/examples/causal_inference/interventional_distribution.ipynb b/examples/causal_inference/interventional_distribution.ipynb index 7c6621d0e..7390fa71b 100644 --- a/examples/causal_inference/interventional_distribution.ipynb +++ b/examples/causal_inference/interventional_distribution.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "id": "f2e8530c-5ba0-4041-a309-18919d5d0533", "metadata": { @@ -12,7 +13,7 @@ }, "source": [ "(interventional_distribution)=\n", - "# Interventional distributions and graph mutilation with the do-operator\n", + "# Interventional distributions and graph mutation with the do-operator\n", "\n", ":::{post} July, 2023\n", ":tags: causal inference, do-operator, graph mutation\n", @@ -22,6 +23,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "8f973a4f-def4-4fb6-b166-2aefbdf5eee2", "metadata": { @@ -44,6 +46,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "ed816fbf-320c-44f7-a711-cb4750d86e24", "metadata": {}, @@ -75,6 +78,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "e2441116-c8a5-41af-be95-9eeddf2b0e2e", "metadata": { @@ -136,6 +140,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "782d6135-2e59-4462-8b9c-9832a58751ef", "metadata": { @@ -259,6 +264,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "f618f053-266b-4006-a521-f892cb8519e1", "metadata": { @@ -281,6 +287,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "ca2ed504-ffda-4f1d-8d18-cdb06608202b", "metadata": { @@ -301,6 +308,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "83b8106f-c9e1-4277-ba38-f13b03a33ef6", "metadata": { @@ -466,6 +474,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "56832ddc-ef61-4dbf-b46f-b6ef2ae8820e", "metadata": { @@ -482,6 +491,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "24792fb8-3e40-41b5-a26a-4a2d4da052ed", "metadata": { @@ -503,6 +513,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "aac4d49b-6a1e-4d77-a9c7-205050bebb9f", "metadata": { @@ -572,6 +583,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "b70e42b0-61a1-4c62-8dd9-d973d60d7946", "metadata": { @@ -727,6 +739,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "3bb5134c-f476-4b8f-9338-1ed07e1fbb13", "metadata": { @@ -763,6 +776,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "e2d1a7ca-1948-4165-92aa-3713df60b73b", "metadata": {}, @@ -773,6 +787,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "453edf32-48d2-4d7f-96fb-6fb61851de9e", "metadata": { @@ -1095,6 +1110,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "07b66542-dd10-43b1-9dfb-5b438f756736", "metadata": { @@ -1164,6 +1180,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "6625a68d-e19e-4490-b486-29e3bff42716", "metadata": { @@ -1178,6 +1195,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "b44eef67-7ad3-46cc-b18c-e589b9fd271b", "metadata": { @@ -1192,6 +1210,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "2d30eb22-2560-495a-8af2-f9c9fe04848a", "metadata": {}, @@ -1219,6 +1238,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "99ccc753-e3ef-4834-b02f-4a8d82749fe5", "metadata": {}, @@ -1227,6 +1247,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "d0896e42-ee27-4c37-a065-7c78d6f6c0e2", "metadata": { @@ -1321,6 +1342,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "95844edc-2e47-47a1-986a-c6e0b30386c0", "metadata": {}, @@ -1471,6 +1493,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "688de710-654d-4905-a328-81941aaa1fe6", "metadata": { @@ -1485,6 +1508,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "01ba8784-cd8b-45e8-b9ec-1fd6d56b010a", "metadata": { @@ -1532,6 +1556,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "d9d4fe62-b694-4a90-9e7f-21344f69fcf6", "metadata": { @@ -1599,6 +1624,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "f546f9e2-0f9b-4eaa-93e3-b5887b757a37", "metadata": { @@ -1675,6 +1701,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "9c4122ee-9709-4c9c-b0eb-a4c20e1b7f3a", "metadata": { @@ -1761,6 +1788,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "dec5c8d6-e562-47ca-a263-2e8269704d04", "metadata": { @@ -1775,6 +1803,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "e546b0ab-dd66-4c20-b814-c8cd1bc6c710", "metadata": { @@ -1797,6 +1826,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "f17a9b3b-a3c2-4919-893b-569049db03d6", "metadata": { @@ -1812,6 +1842,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "ecbb878d-531b-4c96-afe2-c39f928b9162", "metadata": {}, @@ -1824,6 +1855,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "9fd548d0-5977-4a19-935a-506e86063887", "metadata": {}, @@ -1871,6 +1903,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "id": "62e8040f-452c-4a11-90f5-fa94eb03c971", "metadata": { diff --git a/examples/causal_inference/interventional_distribution.myst.md b/examples/causal_inference/interventional_distribution.myst.md index 37bdf5a66..92e90b681 100644 --- a/examples/causal_inference/interventional_distribution.myst.md +++ b/examples/causal_inference/interventional_distribution.myst.md @@ -14,7 +14,7 @@ kernelspec: +++ {"editable": true, "slideshow": {"slide_type": ""}, "tags": []} (interventional_distribution)= -# Interventional distributions and graph mutilation with the do-operator +# Interventional distributions and graph mutation with the do-operator :::{post} July, 2023 :tags: causal inference, do-operator, graph mutation From 5e5cf7b45d9084d2d156b19a06a8fbd2f300ad38 Mon Sep 17 00:00:00 2001 From: "Benjamin T. Vincent" Date: Tue, 4 Jul 2023 21:13:49 +0100 Subject: [PATCH 2/2] remove mention of dataframes --- examples/causal_inference/interventional_distribution.ipynb | 2 +- examples/causal_inference/interventional_distribution.myst.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/causal_inference/interventional_distribution.ipynb b/examples/causal_inference/interventional_distribution.ipynb index 7390fa71b..a153035f1 100644 --- a/examples/causal_inference/interventional_distribution.ipynb +++ b/examples/causal_inference/interventional_distribution.ipynb @@ -798,7 +798,7 @@ "tags": [] }, "source": [ - "However, we are going to implement these using Bayesian causal DAGs with PyMC. Let's see how we can do this, then generate samples from them using `pm.sample_prior_predictive`. As we go with each DAG, we'll package the data up in `DataFrame`'s for plotting later, and also plot the graphviz representation of the PyMC models. You'll see that while these are a fraction more visually complex, they do actually match up with the causal DAGs we've specified above." + "However, we are going to implement these using Bayesian causal DAGs with PyMC. Let's see how we can do this, then generate samples from them using `pm.sample_prior_predictive`. As we go with each DAG, we'll extract the samples for plotting later, and also plot the graphviz representation of the PyMC models. You'll see that while these are a fraction more visually complex, they do actually match up with the causal DAGs we've specified above." ] }, { diff --git a/examples/causal_inference/interventional_distribution.myst.md b/examples/causal_inference/interventional_distribution.myst.md index 92e90b681..1d5c9de47 100644 --- a/examples/causal_inference/interventional_distribution.myst.md +++ b/examples/causal_inference/interventional_distribution.myst.md @@ -329,7 +329,7 @@ These code snippets are important because they define identical joint distributi +++ {"editable": true, "slideshow": {"slide_type": ""}, "tags": []} -However, we are going to implement these using Bayesian causal DAGs with PyMC. Let's see how we can do this, then generate samples from them using `pm.sample_prior_predictive`. As we go with each DAG, we'll package the data up in `DataFrame`'s for plotting later, and also plot the graphviz representation of the PyMC models. You'll see that while these are a fraction more visually complex, they do actually match up with the causal DAGs we've specified above. +However, we are going to implement these using Bayesian causal DAGs with PyMC. Let's see how we can do this, then generate samples from them using `pm.sample_prior_predictive`. As we go with each DAG, we'll extract the samples for plotting later, and also plot the graphviz representation of the PyMC models. You'll see that while these are a fraction more visually complex, they do actually match up with the causal DAGs we've specified above. ```{code-cell} ipython3 ---