From 3619cfde0a7968a00a4078904846f10ec3160512 Mon Sep 17 00:00:00 2001 From: LegrandNico Date: Fri, 17 Nov 2023 12:33:46 +0100 Subject: [PATCH] another test --- .../notebooks/0-Creating_networks.ipynb | 34 ++++++++++--- docs/source/notebooks/0-Creating_networks.md | 10 +++- docs/source/notebooks/0-Theory.ipynb | 8 +++- docs/source/notebooks/0-Theory.md | 2 + docs/source/notebooks/1.1-Binary_HGF.ipynb | 29 ++++++++--- docs/source/notebooks/1.1-Binary_HGF.md | 16 +++++-- .../notebooks/1.2-Categorical_HGF.ipynb | 29 ++++++++--- .../source/notebooks/1.3-Continuous_HGF.ipynb | 33 ++++++++++--- docs/source/notebooks/1.3-Continuous_HGF.md | 12 +++-- .../2-Using_custom_response_functions.ipynb | 39 ++++++++++++--- .../2-Using_custom_response_functions.md | 12 ++++- docs/source/notebooks/3-Multilevel_HGF.ipynb | 44 +++++++++++++---- docs/source/notebooks/3-Multilevel_HGF.md | 20 ++++++-- .../notebooks/4-Parameter_recovery.ipynb | 48 +++++++++++++++---- docs/source/notebooks/4-Parameter_recovery.md | 17 ++++++- .../Example_1_Heart_rate_variability.ipynb | 48 +++++++++++++++---- .../Example_1_Heart_rate_variability.md | 17 ++++++- ...ple_2_Input_node_volatility_coupling.ipynb | 31 +++++++++--- ...xample_2_Input_node_volatility_coupling.md | 10 +++- .../notebooks/Exercise_1_Using_the_HGF.ipynb | 37 +++++++++++--- .../notebooks/Exercise_1_Using_the_HGF.md | 18 +++++-- 21 files changed, 417 insertions(+), 97 deletions(-) diff --git a/docs/source/notebooks/0-Creating_networks.ipynb b/docs/source/notebooks/0-Creating_networks.ipynb index af96536b0..74ce45ae8 100644 --- a/docs/source/notebooks/0-Creating_networks.ipynb +++ b/docs/source/notebooks/0-Creating_networks.ipynb @@ -18,29 +18,49 @@ { "cell_type": "markdown", "id": "e368e07c-2dbb-47df-bf93-f2b8ec3a7e5b", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/0-Creating_networks.ipynb)" ] }, { "cell_type": "code", - "execution_count": 1, - "id": "81a63672", + "execution_count": null, + "id": "93c52124-b1b7-4688-bac6-3886c86b9352", "metadata": { "editable": true, "slideshow": { "slide_type": "" - } + }, + "tags": [] }, "outputs": [], "source": [ "%%capture\n", "import sys\n", - "\n", "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", + " !pip install pyhgf" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "81a63672", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import seaborn as sns\n", diff --git a/docs/source/notebooks/0-Creating_networks.md b/docs/source/notebooks/0-Creating_networks.md index 4281c2614..cb433c510 100644 --- a/docs/source/notebooks/0-Creating_networks.md +++ b/docs/source/notebooks/0-Creating_networks.md @@ -17,7 +17,7 @@ kernelspec: (probabilistic_networks)= # Creating and manipulating networks of probabilistic nodes -+++ ++++ {"editable": true, "slideshow": {"slide_type": ""}} [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/0-Creating_networks.ipynb) @@ -29,10 +29,16 @@ slideshow: --- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +--- import matplotlib.pyplot as plt import numpy as np import seaborn as sns diff --git a/docs/source/notebooks/0-Theory.ipynb b/docs/source/notebooks/0-Theory.ipynb index 52e259e5b..f0d2053ec 100644 --- a/docs/source/notebooks/0-Theory.ipynb +++ b/docs/source/notebooks/0-Theory.ipynb @@ -3,7 +3,13 @@ { "cell_type": "markdown", "id": "c2dcb78a-a246-4537-82f0-82ea35010cda", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "(theory)=\n", "# Introduction to the Hierarchical Gaussian Filter\n", diff --git a/docs/source/notebooks/0-Theory.md b/docs/source/notebooks/0-Theory.md index e67e9ba0a..c88b306a2 100644 --- a/docs/source/notebooks/0-Theory.md +++ b/docs/source/notebooks/0-Theory.md @@ -12,6 +12,8 @@ kernelspec: name: python3 --- ++++ {"editable": true, "slideshow": {"slide_type": ""}} + (theory)= # Introduction to the Hierarchical Gaussian Filter diff --git a/docs/source/notebooks/1.1-Binary_HGF.ipynb b/docs/source/notebooks/1.1-Binary_HGF.ipynb index 5ef52b029..c1c620d1f 100644 --- a/docs/source/notebooks/1.1-Binary_HGF.ipynb +++ b/docs/source/notebooks/1.1-Binary_HGF.ipynb @@ -17,23 +17,40 @@ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/1.1-Binary_HGF.ipynb)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "d805e368-99d3-41b2-a6d9-59a5d7876e82", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "if 'google.colab' in sys.modules:\n", + " !pip install pyhgf" + ] + }, { "cell_type": "code", "execution_count": 1, "id": "927d8f75-a606-4af9-a68b-a182df2ed970", "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, "tags": [ "hide-cell" ] }, "outputs": [], "source": [ - "%%capture\n", - "import sys\n", - "\n", - "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", "import arviz as az\n", "import jax.numpy as jnp\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/notebooks/1.1-Binary_HGF.md b/docs/source/notebooks/1.1-Binary_HGF.md index 4565352fe..68afef0ab 100644 --- a/docs/source/notebooks/1.1-Binary_HGF.md +++ b/docs/source/notebooks/1.1-Binary_HGF.md @@ -20,14 +20,24 @@ kernelspec: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/1.1-Binary_HGF.ipynb) ```{code-cell} ipython3 -:tags: [hide-cell] - +--- +editable: true +slideshow: + slide_type: '' +--- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +tags: [hide-cell] +--- import arviz as az import jax.numpy as jnp import matplotlib.pyplot as plt diff --git a/docs/source/notebooks/1.2-Categorical_HGF.ipynb b/docs/source/notebooks/1.2-Categorical_HGF.ipynb index c0e1f2bcf..b9285edf4 100644 --- a/docs/source/notebooks/1.2-Categorical_HGF.ipynb +++ b/docs/source/notebooks/1.2-Categorical_HGF.ipynb @@ -21,23 +21,40 @@ "```" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "e9143ab5-131e-4a1c-9130-326c3538f888", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "if 'google.colab' in sys.modules:\n", + " !pip install pyhgf" + ] + }, { "cell_type": "code", "execution_count": 1, "id": "d2c1e257-91ab-455d-a3ea-0ac0136797ed", "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, "tags": [ "hide-cell" ] }, "outputs": [], "source": [ - "%%capture\n", - "import sys\n", - "\n", - "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", "import arviz as az\n", "import jax.numpy as jnp\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/notebooks/1.3-Continuous_HGF.ipynb b/docs/source/notebooks/1.3-Continuous_HGF.ipynb index 0dba6b920..23a33e40c 100644 --- a/docs/source/notebooks/1.3-Continuous_HGF.ipynb +++ b/docs/source/notebooks/1.3-Continuous_HGF.ipynb @@ -18,11 +18,36 @@ { "cell_type": "markdown", "id": "fb99e4b3-b5f6-4393-b6f0-f867d61b1223", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/1.2-Continuous_HGF.ipynb)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "08c9af0d-6dc1-46ce-a41e-ec694b6f5940", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "if 'google.colab' in sys.modules:\n", + " !pip install pyhgf" + ] + }, { "cell_type": "code", "execution_count": 1, @@ -38,12 +63,6 @@ }, "outputs": [], "source": [ - "%%capture\n", - "import sys\n", - "\n", - "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", "import arviz as az\n", "import jax.numpy as jnp\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/notebooks/1.3-Continuous_HGF.md b/docs/source/notebooks/1.3-Continuous_HGF.md index 9217932bb..d7405eeb9 100644 --- a/docs/source/notebooks/1.3-Continuous_HGF.md +++ b/docs/source/notebooks/1.3-Continuous_HGF.md @@ -17,7 +17,7 @@ kernelspec: (continuous_hgf)= # The continuous Hierarchical Gaussian Filter -+++ ++++ {"editable": true, "slideshow": {"slide_type": ""}} [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/1.2-Continuous_HGF.ipynb) @@ -26,14 +26,20 @@ kernelspec: editable: true slideshow: slide_type: '' -tags: [hide-cell] --- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +tags: [hide-cell] +--- import arviz as az import jax.numpy as jnp import matplotlib.pyplot as plt diff --git a/docs/source/notebooks/2-Using_custom_response_functions.ipynb b/docs/source/notebooks/2-Using_custom_response_functions.ipynb index d891b3fdf..ff310ddd6 100644 --- a/docs/source/notebooks/2-Using_custom_response_functions.ipynb +++ b/docs/source/notebooks/2-Using_custom_response_functions.ipynb @@ -3,7 +3,13 @@ { "cell_type": "markdown", "id": "3aebaca2-f14e-4b6f-9d68-8ff7ea3c7b71", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "(custom_response_functions)=\n", "# Using custom response models" @@ -12,15 +18,21 @@ { "cell_type": "markdown", "id": "1a9a9835-a027-4c14-9649-e7b51545b83d", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/2-Using_custom_response_functions.ipynb)" ] }, { "cell_type": "code", - "execution_count": 1, - "id": "96efb544-a8f7-44af-8345-ab6af53aaaf5", + "execution_count": null, + "id": "6522fb9d-5799-4fe4-848e-a711bd3c2e15", "metadata": { "editable": true, "slideshow": { @@ -32,10 +44,23 @@ "source": [ "%%capture\n", "import sys\n", - "\n", "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", + " !pip install pyhgf" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "96efb544-a8f7-44af-8345-ab6af53aaaf5", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ "import arviz as az\n", "import jax.numpy as jnp\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/notebooks/2-Using_custom_response_functions.md b/docs/source/notebooks/2-Using_custom_response_functions.md index 1aff8de32..7716129d7 100644 --- a/docs/source/notebooks/2-Using_custom_response_functions.md +++ b/docs/source/notebooks/2-Using_custom_response_functions.md @@ -12,10 +12,12 @@ kernelspec: name: python3 --- ++++ {"editable": true, "slideshow": {"slide_type": ""}} + (custom_response_functions)= # Using custom response models -+++ ++++ {"editable": true, "slideshow": {"slide_type": ""}} [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/2-Using_custom_response_functions.ipynb) @@ -27,10 +29,16 @@ slideshow: --- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +--- import arviz as az import jax.numpy as jnp import matplotlib.pyplot as plt diff --git a/docs/source/notebooks/3-Multilevel_HGF.ipynb b/docs/source/notebooks/3-Multilevel_HGF.ipynb index d4761cf36..c3893fb9a 100644 --- a/docs/source/notebooks/3-Multilevel_HGF.ipynb +++ b/docs/source/notebooks/3-Multilevel_HGF.ipynb @@ -3,7 +3,13 @@ { "cell_type": "markdown", "id": "3d531da8-f5e7-4979-9c95-a2dd12c8298e", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "(multilevel_hgf)=\n", "# Multilevel embeding of Hierarchical Gaussian Filters" @@ -13,40 +19,62 @@ "cell_type": "markdown", "id": "ab7fa0a5-7fc9-47b8-96da-4ff5820a8f70", "metadata": { + "editable": true, "execution": { "iopub.execute_input": "2023-11-06T08:59:25.111871Z", "iopub.status.busy": "2023-11-06T08:59:25.110906Z", "iopub.status.idle": "2023-11-06T08:59:25.122657Z", "shell.execute_reply": "2023-11-06T08:59:25.121477Z" - } + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/3-Multilevel_HGF.ipynb)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba34f2ab-bca8-499d-bfd5-f2c022409b50", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "if 'google.colab' in sys.modules:\n", + " !pip install pyhgf" + ] + }, { "cell_type": "code", "execution_count": 2, "id": "b2718c0d-5a41-4f56-89be-80318f9ab728", "metadata": { + "editable": true, "execution": { "iopub.execute_input": "2023-11-06T08:59:25.126516Z", "iopub.status.busy": "2023-11-06T08:59:25.126230Z", "iopub.status.idle": "2023-11-06T08:59:29.157547Z", "shell.execute_reply": "2023-11-06T08:59:29.156092Z" }, + "slideshow": { + "slide_type": "" + }, "tags": [ "hide-cell" ] }, "outputs": [], "source": [ - "%%capture\n", - "import sys\n", - "\n", - "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", "import arviz as az\n", "import jax.numpy as jnp\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/notebooks/3-Multilevel_HGF.md b/docs/source/notebooks/3-Multilevel_HGF.md index b4e55d1c9..74f8cd8d9 100644 --- a/docs/source/notebooks/3-Multilevel_HGF.md +++ b/docs/source/notebooks/3-Multilevel_HGF.md @@ -12,22 +12,34 @@ kernelspec: name: python3 --- ++++ {"editable": true, "slideshow": {"slide_type": ""}} + (multilevel_hgf)= # Multilevel embeding of Hierarchical Gaussian Filters -+++ ++++ {"editable": true, "slideshow": {"slide_type": ""}} [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/3-Multilevel_HGF.ipynb) ```{code-cell} ipython3 -:tags: [hide-cell] - +--- +editable: true +slideshow: + slide_type: '' +--- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +tags: [hide-cell] +--- import arviz as az import jax.numpy as jnp import matplotlib.pyplot as plt diff --git a/docs/source/notebooks/4-Parameter_recovery.ipynb b/docs/source/notebooks/4-Parameter_recovery.ipynb index b6c5f6f12..e2f77a075 100644 --- a/docs/source/notebooks/4-Parameter_recovery.ipynb +++ b/docs/source/notebooks/4-Parameter_recovery.ipynb @@ -3,7 +3,13 @@ { "cell_type": "markdown", "id": "3d531da8-f5e7-4979-9c95-a2dd12c8298e", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "(parameters_recovery)=\n", "# Parameters recovery, prior predictive and posterior predictive sampling" @@ -12,31 +18,55 @@ { "cell_type": "markdown", "id": "5d880108-f486-4fcc-8bf3-651c6c8b829c", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/4-Parameter_recovery.ipynb)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "e00c09dd-b0ed-4e32-8bc7-af5868acdcd3", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "if 'google.colab' in sys.modules:\n", + " !pip install pyhgf" + ] + }, { "cell_type": "code", "execution_count": 1, "id": "4bc4fb2a-0224-4374-b046-76ab5904e757", "metadata": { + "editable": true, "execution": { "iopub.execute_input": "2023-11-06T09:01:29.680704Z", "iopub.status.busy": "2023-11-06T09:01:29.680443Z", "iopub.status.idle": "2023-11-06T09:01:33.979724Z", "shell.execute_reply": "2023-11-06T09:01:33.978722Z" - } + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] }, "outputs": [], "source": [ - "%%capture\n", - "import sys\n", - "\n", - "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", "import arviz as az\n", "import jax.numpy as jnp\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/notebooks/4-Parameter_recovery.md b/docs/source/notebooks/4-Parameter_recovery.md index 239606c74..28725ed21 100644 --- a/docs/source/notebooks/4-Parameter_recovery.md +++ b/docs/source/notebooks/4-Parameter_recovery.md @@ -12,20 +12,33 @@ kernelspec: name: python3 --- ++++ {"editable": true, "slideshow": {"slide_type": ""}} + (parameters_recovery)= # Parameters recovery, prior predictive and posterior predictive sampling -+++ ++++ {"editable": true, "slideshow": {"slide_type": ""}} [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/4-Parameter_recovery.ipynb) ```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +--- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +--- import arviz as az import jax.numpy as jnp import matplotlib.pyplot as plt diff --git a/docs/source/notebooks/Example_1_Heart_rate_variability.ipynb b/docs/source/notebooks/Example_1_Heart_rate_variability.ipynb index 75d3e3218..457a3756e 100644 --- a/docs/source/notebooks/Example_1_Heart_rate_variability.ipynb +++ b/docs/source/notebooks/Example_1_Heart_rate_variability.ipynb @@ -3,7 +3,13 @@ { "cell_type": "markdown", "id": "3d531da8-f5e7-4979-9c95-a2dd12c8298e", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "(example_1)=\n", "# Example 1: Bayesian filtering of cardiac volatility" @@ -12,31 +18,55 @@ { "cell_type": "markdown", "id": "c013ea97-4534-48f7-b9c9-930fdafaa3fd", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/Example_1_Heart_rate_variability.ipynb)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "11c4c38d-4387-4c13-accf-1736b0451cad", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "if 'google.colab' in sys.modules:\n", + " !pip install pyhgf systole" + ] + }, { "cell_type": "code", "execution_count": 1, "id": "53f8336b-b700-42b6-b037-99607bc18ad9", "metadata": { + "editable": true, "execution": { "iopub.execute_input": "2023-11-06T09:02:20.281167Z", "iopub.status.busy": "2023-11-06T09:02:20.280313Z", "iopub.status.idle": "2023-11-06T09:02:24.918431Z", "shell.execute_reply": "2023-11-06T09:02:24.917303Z" - } + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] }, "outputs": [], "source": [ - "%%capture\n", - "import sys\n", - "\n", - "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf systole\n", - "\n", "import arviz as az\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", diff --git a/docs/source/notebooks/Example_1_Heart_rate_variability.md b/docs/source/notebooks/Example_1_Heart_rate_variability.md index d50a102dd..3f0f92ece 100644 --- a/docs/source/notebooks/Example_1_Heart_rate_variability.md +++ b/docs/source/notebooks/Example_1_Heart_rate_variability.md @@ -12,20 +12,33 @@ kernelspec: name: python3 --- ++++ {"editable": true, "slideshow": {"slide_type": ""}} + (example_1)= # Example 1: Bayesian filtering of cardiac volatility -+++ ++++ {"editable": true, "slideshow": {"slide_type": ""}} [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/Example_1_Heart_rate_variability.ipynb) ```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +--- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf systole +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +--- import arviz as az import matplotlib.pyplot as plt import numpy as np diff --git a/docs/source/notebooks/Example_2_Input_node_volatility_coupling.ipynb b/docs/source/notebooks/Example_2_Input_node_volatility_coupling.ipynb index ae8860b60..309ef65c3 100644 --- a/docs/source/notebooks/Example_2_Input_node_volatility_coupling.ipynb +++ b/docs/source/notebooks/Example_2_Input_node_volatility_coupling.ipynb @@ -18,15 +18,21 @@ { "cell_type": "markdown", "id": "a433e73e-e20e-459e-9744-6193ae31898c", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/Example_2_Input_node_volatility_coupling.ipynb)" ] }, { "cell_type": "code", - "execution_count": 1, - "id": "edfee021-57f2-434a-9841-990ddeb4ee00", + "execution_count": null, + "id": "bc2f0d67-9f24-4e44-ad7b-c04c22cff638", "metadata": { "editable": true, "slideshow": { @@ -38,10 +44,23 @@ "source": [ "%%capture\n", "import sys\n", - "\n", "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", + " !pip install pyhgf" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "edfee021-57f2-434a-9841-990ddeb4ee00", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ "import arviz as az\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", diff --git a/docs/source/notebooks/Example_2_Input_node_volatility_coupling.md b/docs/source/notebooks/Example_2_Input_node_volatility_coupling.md index 24fcdffea..cf384cfb9 100644 --- a/docs/source/notebooks/Example_2_Input_node_volatility_coupling.md +++ b/docs/source/notebooks/Example_2_Input_node_volatility_coupling.md @@ -17,7 +17,7 @@ kernelspec: (example_2)= # Example 2: Estimating the mean and precision of an input node -+++ ++++ {"editable": true, "slideshow": {"slide_type": ""}} [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/Example_2_Input_node_volatility_coupling.ipynb) @@ -29,10 +29,16 @@ slideshow: --- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +--- import arviz as az import matplotlib.pyplot as plt import numpy as np diff --git a/docs/source/notebooks/Exercise_1_Using_the_HGF.ipynb b/docs/source/notebooks/Exercise_1_Using_the_HGF.ipynb index 63caca603..7b922ec5d 100644 --- a/docs/source/notebooks/Exercise_1_Using_the_HGF.ipynb +++ b/docs/source/notebooks/Exercise_1_Using_the_HGF.ipynb @@ -18,34 +18,57 @@ { "cell_type": "markdown", "id": "44cc9869-d0be-4cd4-8309-dfc37a1d0a01", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/Exercise_1_Using_the_HGF.ipynb)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "56fadf0b-a1b3-4aeb-9d81-efd17975448d", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "%%capture\n", + "import sys\n", + "if 'google.colab' in sys.modules:\n", + " !pip install pyhgf" + ] + }, { "cell_type": "code", "execution_count": 1, "id": "48931dea-0be4-4f9e-8989-209d5d3d30b5", "metadata": { + "editable": true, "execution": { "iopub.execute_input": "2023-11-06T09:02:59.772473Z", "iopub.status.busy": "2023-11-06T09:02:59.772193Z", "iopub.status.idle": "2023-11-06T09:03:03.632771Z", "shell.execute_reply": "2023-11-06T09:03:03.630725Z" }, + "slideshow": { + "slide_type": "" + }, "tags": [ "hide-cell" ] }, "outputs": [], "source": [ - "%%capture\n", - "import sys\n", - "\n", - "if 'google.colab' in sys.modules:\n", - " !pip install pyhgf\n", - "\n", "import arviz as az\n", "import jax.numpy as jnp\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/source/notebooks/Exercise_1_Using_the_HGF.md b/docs/source/notebooks/Exercise_1_Using_the_HGF.md index a99454cff..8ba5d2178 100644 --- a/docs/source/notebooks/Exercise_1_Using_the_HGF.md +++ b/docs/source/notebooks/Exercise_1_Using_the_HGF.md @@ -17,19 +17,29 @@ kernelspec: (hgf_exercises)= # An introduction to Hierarchical Gaussian Filters through practical exercises -+++ ++++ {"editable": true, "slideshow": {"slide_type": ""}} [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ilabcode/pyhgf/blob/master/docs/source/notebooks/Exercise_1_Using_the_HGF.ipynb) ```{code-cell} ipython3 -:tags: [hide-cell] - +--- +editable: true +slideshow: + slide_type: '' +--- %%capture import sys - if 'google.colab' in sys.modules: !pip install pyhgf +``` +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +tags: [hide-cell] +--- import arviz as az import jax.numpy as jnp import matplotlib.pyplot as plt