diff --git a/lectures/_static/lecture_specific/graphviz/graphviz_generation.ipynb b/lectures/_static/lecture_specific/graphviz/graphviz_generation.ipynb deleted file mode 100644 index 03c74116..00000000 --- a/lectures/_static/lecture_specific/graphviz/graphviz_generation.ipynb +++ /dev/null @@ -1,565 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "ccd1c797-db85-4293-8436-0cd442d1d9ae", - "metadata": {}, - "source": [ - "# Code for Graphviz Plots " - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "6f6a377d-1fc8-4f2a-8e92-b550a7c92828", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: graphviz in /Users/mmcky/anaconda3/envs/quantecon/lib/python3.11/site-packages (0.20.3)\n" - ] - } - ], - "source": [ - "!pip install graphviz" - ] - }, - { - "cell_type": "markdown", - "id": "ad403a5a-868c-45ed-a360-a81aee9cfd38", - "metadata": {}, - "source": [ - "```{admonition} graphviz\n", - ":class: warning\n", - "If you are running this lecture locally it requires [graphviz](https://www.graphviz.org)\n", - "to be installed on your computer. Installation instructions for graphviz can be found\n", - "[here](https://www.graphviz.org/download/) \n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "428161a2-e0d5-402e-bf16-1d1e460a30e7", - "metadata": {}, - "outputs": [], - "source": [ - "from graphviz import Digraph\n" - ] - }, - { - "cell_type": "markdown", - "id": "75d07327-0fcc-41f1-8d36-b8b8d4eb1060", - "metadata": {}, - "source": [ - "## Lake model" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "16e9379d-bf94-4c79-9a34-4dbc2cc41b0e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../lake_model/lake_model_worker.png'" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Create Digraph object\n", - "G = Digraph(format='png')\n", - "G.attr(rankdir='LR')\n", - "\n", - "# Add nodes\n", - "G.attr('node', shape='circle')\n", - "G.node('1', 'New entrants', color='blue')\n", - "G.node('2', 'Unemployed')\n", - "G.node('3', 'Employed')\n", - "\n", - "# Add edges\n", - "G.edge('1', '2', label='b')\n", - "G.edge('2', '3', label='λ(1-d)')\n", - "G.edge('3', '2', label='α(1-d)')\n", - "G.edge('2', '2', label='(1-λ)(1-d)')\n", - "G.edge('3', '3', label='(1-α)(1-d)')\n", - "\n", - "# Save Plot\n", - "G.render(filename='../lake_model/lake_model_worker')" - ] - }, - { - "cell_type": "markdown", - "id": "194ca10b-dd02-4210-adbc-c2bb8b699d45", - "metadata": {}, - "source": [ - "## Markov chains I\n", - "\n", - "### Example 1\n", - "\n", - "Hamilton on US unemployment data" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "75e86ad6-d11c-4c36-920d-cbab0e3d97d2", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../markov_chains_I/Hamilton.png'" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png')\n", - "dot.attr(rankdir='LR')\n", - "dot.node(\"ng\")\n", - "dot.node(\"mr\")\n", - "dot.node(\"sr\")\n", - "\n", - "dot.edge(\"ng\", \"ng\", label=\"0.971\")\n", - "dot.edge(\"ng\", \"mr\", label=\"0.029\")\n", - "dot.edge(\"mr\", \"ng\", label=\"0.145\")\n", - "\n", - "dot.edge(\"mr\", \"mr\", label=\"0.778\")\n", - "dot.edge(\"mr\", \"sr\", label=\"0.077\")\n", - "dot.edge(\"sr\", \"mr\", label=\"0.508\")\n", - "\n", - "dot.edge(\"sr\", \"sr\", label=\"0.492\")\n", - "dot\n", - "\n", - "dot.render(filename='../markov_chains_I/Hamilton')" - ] - }, - { - "cell_type": "markdown", - "id": "1b7b4b45-f6a4-495d-9115-638aafe9acd8", - "metadata": {}, - "source": [ - "### Exercise 1\n", - "\n", - "Solution 2:" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "46c4612f-3f8b-4c83-b02a-81fe67545e8f", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../markov_chains_I/Temple.png'" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png')\n", - "dot.attr(rankdir='LR')\n", - "dot.node(\"Growth\")\n", - "dot.node(\"Stagnation\")\n", - "dot.node(\"Collapse\")\n", - "\n", - "dot.edge(\"Growth\", \"Growth\", label=\"0.68\")\n", - "dot.edge(\"Growth\", \"Stagnation\", label=\"0.12\")\n", - "dot.edge(\"Growth\", \"Collapse\", label=\"0.20\")\n", - "\n", - "dot.edge(\"Stagnation\", \"Stagnation\", label=\"0.24\")\n", - "dot.edge(\"Stagnation\", \"Growth\", label=\"0.50\")\n", - "dot.edge(\"Stagnation\", \"Collapse\", label=\"0.26\")\n", - "\n", - "dot.edge(\"Collapse\", \"Collapse\", label=\"0.46\")\n", - "dot.edge(\"Collapse\", \"Stagnation\", label=\"0.18\")\n", - "dot.edge(\"Collapse\", \"Growth\", label=\"0.36\")\n", - "\n", - "dot\n", - "\n", - "dot.render(filename='../markov_chains_I/Temple')" - ] - }, - { - "cell_type": "markdown", - "id": "360e6241-2bdc-425e-903a-dab3c5ef0485", - "metadata": {}, - "source": [ - "## Markov chains II\n", - "\n", - "### Irreducibility" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "b2fc20fe-9031-4212-a911-6dad6f49ccd3", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../markov_chains_II/Irre_1.png'" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png')\n", - "dot.attr(rankdir='LR')\n", - "dot.node(\"poor\")\n", - "dot.node(\"middle class\")\n", - "dot.node(\"rich\")\n", - "\n", - "dot.edge(\"poor\", \"poor\", label=\"0.9\")\n", - "dot.edge(\"poor\", \"middle class\", label=\"0.1\")\n", - "dot.edge(\"middle class\", \"poor\", label=\"0.4\")\n", - "dot.edge(\"middle class\", \"middle class\", label=\"0.4\")\n", - "dot.edge(\"middle class\", \"rich\", label=\"0.2\")\n", - "dot.edge(\"rich\", \"poor\", label=\"0.1\")\n", - "dot.edge(\"rich\", \"middle class\", label=\"0.1\")\n", - "dot.edge(\"rich\", \"rich\", label=\"0.8\")\n", - "\n", - "dot\n", - "dot.render(filename='../markov_chains_II/Irre_1')" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "6d7a66a3-840b-4920-b7d0-eac8c95ab518", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../markov_chains_II/Irre_2.png'" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png')\n", - "dot.attr(rankdir='LR')\n", - "dot.node(\"poor\")\n", - "dot.node(\"middle class\")\n", - "dot.node(\"rich\")\n", - "\n", - "dot.edge(\"poor\", \"poor\", label=\"1.0\")\n", - "dot.edge(\"middle class\", \"poor\", label=\"0.1\")\n", - "dot.edge(\"middle class\", \"middle class\", label=\"0.8\")\n", - "dot.edge(\"middle class\", \"rich\", label=\"0.1\")\n", - "dot.edge(\"rich\", \"middle class\", label=\"0.2\")\n", - "dot.edge(\"rich\", \"rich\", label=\"0.8\")\n", - "\n", - "dot\n", - "dot.render(filename='../markov_chains_II/Irre_2')" - ] - }, - { - "cell_type": "markdown", - "id": "a1d1ef38-f6ee-4c45-b922-d6c72ae0acc2", - "metadata": {}, - "source": [ - "### Example 4" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "2d1becb5-6593-49e2-990f-e6a8799b7c2c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../markov_chains_II/example4.png'" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png')\n", - "dot.attr(rankdir='LR')\n", - "dot.node(\"0\")\n", - "dot.node(\"1\")\n", - "\n", - "dot.edge(\"0\", \"1\", label=\"1.0\")\n", - "dot.edge(\"1\", \"0\", label=\"1.0\")\n", - "\n", - "dot\n", - "dot.render(filename='../markov_chains_II/example4')" - ] - }, - { - "cell_type": "markdown", - "id": "a9664ecd-eb62-44e3-89fa-f83555c51b74", - "metadata": {}, - "source": [ - "## Networks" - ] - }, - { - "cell_type": "markdown", - "id": "5df3cbb7-f540-4375-8448-c2aaa5526d56", - "metadata": {}, - "source": [ - "### Markov chains" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "f5f64c3a-c7f4-4f7f-86f5-d47d0d3a0d5c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../networks/mc.png'" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png')\n", - "dot.attr(rankdir='LR')\n", - "\n", - "dot.node(\"ng\")\n", - "dot.node(\"mr\")\n", - "dot.node(\"sr\")\n", - "\n", - "dot.edge(\"ng\", \"ng\", label=\"0.971\")\n", - "dot.edge(\"ng\", \"mr\", label=\"0.029\")\n", - "dot.edge(\"mr\", \"ng\", label=\"0.145\")\n", - "dot.edge(\"mr\", \"mr\", label=\"0.778\")\n", - "dot.edge(\"mr\", \"sr\", label=\"0.077\")\n", - "dot.edge(\"sr\", \"mr\", label=\"0.508\")\n", - "dot.edge(\"sr\", \"sr\", label=\"0.492\")\n", - "\n", - "dot\n", - "dot.render(filename='../networks/mc')" - ] - }, - { - "cell_type": "markdown", - "id": "395fa1f8-6e8d-4ac5-bc71-f34b0b9c1e9c", - "metadata": {}, - "source": [ - "### Poverty trap" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "4f4434d5-f434-41eb-ac4b-f0642d3c48c4", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../networks/poverty_trap_1.png'" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png',engine = \"neato\")\n", - "dot.attr(rankdir='LR')\n", - "dot.node(\"poor\", pos='0,0!')\n", - "dot.node(\"middle class\", pos='2,1!')\n", - "dot.node(\"rich\", pos='4,0!')\n", - "\n", - "dot.edge(\"poor\", \"poor\")\n", - "dot.edge(\"poor\", \"middle class\")\n", - "dot.edge(\"middle class\", \"poor\")\n", - "dot.edge(\"middle class\", \"middle class\")\n", - "dot.edge(\"middle class\", \"rich\")\n", - "dot.edge(\"rich\", \"poor\")\n", - "dot.edge(\"rich\", \"middle class\")\n", - "dot.edge(\"rich\", \"rich\")\n", - "\n", - "dot\n", - "dot.render(filename='../networks/poverty_trap_1')" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "ed47732a-9e2b-4d0d-a08a-5303bf8107c2", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../networks/poverty_trap_2.png'" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png',engine=\"neato\")\n", - "dot.attr(rankdir='LR')\n", - "dot.node(\"poor\", pos='0,0!')\n", - "dot.node(\"middle class\", pos='2,1!')\n", - "dot.node(\"rich\", pos='4,0!')\n", - "\n", - "dot.edge(\"poor\", \"poor\")\n", - "dot.edge(\"middle class\", \"poor\")\n", - "dot.edge(\"middle class\", \"middle class\")\n", - "dot.edge(\"middle class\", \"rich\")\n", - "dot.edge(\"rich\", \"poor\")\n", - "dot.edge(\"rich\", \"middle class\")\n", - "dot.edge(\"rich\", \"rich\")\n", - "\n", - "dot\n", - "dot.render(filename='../networks/poverty_trap_2')" - ] - }, - { - "cell_type": "markdown", - "id": "b43e5057-94eb-45e4-80e5-9f85a3c8be52", - "metadata": {}, - "source": [ - "### Weighted directed graph" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "818c342c-87a4-4f30-9c78-79577f257698", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../networks/weighted.png'" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png')\n", - "\n", - "dot.attr(rankdir='LR')\n", - "dot.node(\"poor\")\n", - "dot.node(\"middle class\")\n", - "dot.node(\"rich\")\n", - "\n", - "dot.edge(\"poor\", \"poor\", label='0.9')\n", - "dot.edge(\"poor\", \"middle class\", label='0.1')\n", - "dot.edge(\"middle class\", \"poor\", label='0.4')\n", - "dot.edge(\"middle class\", \"middle class\", label='0.4')\n", - "dot.edge(\"middle class\", \"rich\", label='0.2')\n", - "dot.edge(\"rich\", \"poor\", label='0.1')\n", - "dot.edge(\"rich\", \"middle class\", label='0.1')\n", - "dot.edge(\"rich\", \"rich\", label='0.8')\n", - "\n", - "dot\n", - "dot.render(filename='../networks/weighted')" - ] - }, - { - "cell_type": "markdown", - "id": "074ccf20-618b-456c-9257-36ac2e2b6cfa", - "metadata": {}, - "source": [ - "### Properties" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "778d9e00-3224-4ab7-ba72-c87b96fb654b", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'../networks/properties.png'" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dot = Digraph(format='png')\n", - "\n", - "dot.attr(rankdir='LR')\n", - "dot.node('1')\n", - "dot.node('2')\n", - "dot.node('3')\n", - "\n", - "dot.edge('1', '2', label='0.7')\n", - "dot.edge('1', '3', label='0.3')\n", - "dot.edge('2', '1', label='1')\n", - "dot.edge('3', '1', label='0.4')\n", - "dot.edge('3', '2', label='0.6')\n", - "\n", - "dot\n", - "dot.render(filename='../networks/properties')" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.7" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/lectures/_static/lecture_specific/lake_model/figures.ipynb b/lectures/_static/lecture_specific/lake_model/figures.ipynb new file mode 100644 index 00000000..2acf3b67 --- /dev/null +++ b/lectures/_static/lecture_specific/lake_model/figures.ipynb @@ -0,0 +1,108 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3c1ab515-e765-48f5-bfaf-35d4f95581fd", + "metadata": {}, + "source": [ + "# Figures for Lake Model Lecture" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "45727b3e-f531-4a31-b838-840ccf9d3c02", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: graphviz in /Users/mmcky/anaconda3/envs/quantecon/lib/python3.11/site-packages (0.20.3)\n" + ] + } + ], + "source": [ + "!pip install graphviz" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "68e95ec8-877e-416a-a8ff-665715dfe222", + "metadata": {}, + "outputs": [], + "source": [ + "from graphviz import Digraph" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "92a57207-4d79-4d7b-98c2-aea1a1e35f57", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'lake_model_worker.png'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Create Digraph object\n", + "G = Digraph(format='png')\n", + "G.attr(rankdir='LR')\n", + "\n", + "# Add nodes\n", + "G.attr('node', shape='circle')\n", + "G.node('1', 'New entrants', color='blue')\n", + "G.node('2', 'Unemployed')\n", + "G.node('3', 'Employed')\n", + "\n", + "# Add edges\n", + "G.edge('1', '2', label='b')\n", + "G.edge('2', '3', label='λ(1-d)')\n", + "G.edge('3', '2', label='α(1-d)')\n", + "G.edge('2', '2', label='(1-λ)(1-d)')\n", + "G.edge('3', '3', label='(1-α)(1-d)')\n", + "\n", + "# Save Plot\n", + "G.render(filename='lake_model_worker')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f6c2af58-4d38-44c3-adb0-d1a92a344e51", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/lectures/_static/lecture_specific/lake_model/lake_model_worker b/lectures/_static/lecture_specific/lake_model/lake_model_worker new file mode 100644 index 00000000..92912137 --- /dev/null +++ b/lectures/_static/lecture_specific/lake_model/lake_model_worker @@ -0,0 +1,12 @@ +digraph { + rankdir=LR + node [shape=circle] + 1 [label="New entrants" color=blue] + 2 [label=Unemployed] + 3 [label=Employed] + 1 -> 2 [label=b] + 2 -> 3 [label="λ(1-d)"] + 3 -> 2 [label="α(1-d)"] + 2 -> 2 [label="(1-λ)(1-d)"] + 3 -> 3 [label="(1-α)(1-d)"] +} diff --git a/lectures/_static/lecture_specific/lake_model/lake_model_worker.png b/lectures/_static/lecture_specific/lake_model/lake_model_worker.png index 396d48ff..802a23c7 100644 Binary files a/lectures/_static/lecture_specific/lake_model/lake_model_worker.png and b/lectures/_static/lecture_specific/lake_model/lake_model_worker.png differ diff --git a/lectures/_static/lecture_specific/markov_chains_I/Hamilton b/lectures/_static/lecture_specific/markov_chains_I/Hamilton new file mode 100644 index 00000000..ca9ddc78 --- /dev/null +++ b/lectures/_static/lecture_specific/markov_chains_I/Hamilton @@ -0,0 +1,13 @@ +digraph { + rankdir=LR + ng + mr + sr + ng -> ng [label=0.971] + ng -> mr [label=0.029] + mr -> ng [label=0.145] + mr -> mr [label=0.778] + mr -> sr [label=0.077] + sr -> mr [label=0.508] + sr -> sr [label=0.492] +} diff --git a/lectures/_static/lecture_specific/markov_chains_I/Hamilton.png b/lectures/_static/lecture_specific/markov_chains_I/Hamilton.png index 774b4092..caeccf2b 100644 Binary files a/lectures/_static/lecture_specific/markov_chains_I/Hamilton.png and b/lectures/_static/lecture_specific/markov_chains_I/Hamilton.png differ diff --git a/lectures/_static/lecture_specific/markov_chains_I/Temple b/lectures/_static/lecture_specific/markov_chains_I/Temple new file mode 100644 index 00000000..7d4d2ad6 --- /dev/null +++ b/lectures/_static/lecture_specific/markov_chains_I/Temple @@ -0,0 +1,15 @@ +digraph { + rankdir=LR + Growth + Stagnation + Collapse + Growth -> Growth [label=0.68] + Growth -> Stagnation [label=0.12] + Growth -> Collapse [label=0.20] + Stagnation -> Stagnation [label=0.24] + Stagnation -> Growth [label=0.50] + Stagnation -> Collapse [label=0.26] + Collapse -> Collapse [label=0.46] + Collapse -> Stagnation [label=0.18] + Collapse -> Growth [label=0.36] +} diff --git a/lectures/_static/lecture_specific/markov_chains_I/Temple.png b/lectures/_static/lecture_specific/markov_chains_I/Temple.png index d6aea1e0..41f07a0d 100644 Binary files a/lectures/_static/lecture_specific/markov_chains_I/Temple.png and b/lectures/_static/lecture_specific/markov_chains_I/Temple.png differ diff --git a/lectures/_static/lecture_specific/markov_chains_I/figures.ipynb b/lectures/_static/lecture_specific/markov_chains_I/figures.ipynb new file mode 100644 index 00000000..c76bec7c --- /dev/null +++ b/lectures/_static/lecture_specific/markov_chains_I/figures.ipynb @@ -0,0 +1,168 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "43b11347-069e-4c50-b093-4635361408fc", + "metadata": {}, + "source": [ + "# Figures for Markov Chains I" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "38b0e8a2-acab-4b27-95b3-96174c7d6863", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: graphviz in /Users/mmcky/anaconda3/envs/quantecon/lib/python3.11/site-packages (0.20.3)\n" + ] + } + ], + "source": [ + "!pip install graphviz" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "606da6ac-e8b7-49c6-9d88-142e18e02bba", + "metadata": {}, + "outputs": [], + "source": [ + "from graphviz import Digraph" + ] + }, + { + "cell_type": "markdown", + "id": "87430938-745b-45d3-9895-937bc357432d", + "metadata": {}, + "source": [ + "## Example 1\n", + "\n", + "Hamilton on US unemployment data" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "eff7a6b5-98d4-4f26-b72f-7100a911644e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Hamilton.png'" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png')\n", + "dot.attr(rankdir='LR')\n", + "dot.node(\"ng\")\n", + "dot.node(\"mr\")\n", + "dot.node(\"sr\")\n", + "\n", + "dot.edge(\"ng\", \"ng\", label=\"0.971\")\n", + "dot.edge(\"ng\", \"mr\", label=\"0.029\")\n", + "dot.edge(\"mr\", \"ng\", label=\"0.145\")\n", + "\n", + "dot.edge(\"mr\", \"mr\", label=\"0.778\")\n", + "dot.edge(\"mr\", \"sr\", label=\"0.077\")\n", + "dot.edge(\"sr\", \"mr\", label=\"0.508\")\n", + "\n", + "dot.edge(\"sr\", \"sr\", label=\"0.492\")\n", + "dot\n", + "\n", + "dot.render(filename='Hamilton')" + ] + }, + { + "cell_type": "markdown", + "id": "7effdaa6-ee97-4634-811c-1b90d7e95543", + "metadata": {}, + "source": [ + "## Exercise 1\n", + "\n", + "Solution 2:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "bb57212a-c0f2-4922-a549-0edea60ec590", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Temple.png'" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png')\n", + "dot.attr(rankdir='LR')\n", + "dot.node(\"Growth\")\n", + "dot.node(\"Stagnation\")\n", + "dot.node(\"Collapse\")\n", + "\n", + "dot.edge(\"Growth\", \"Growth\", label=\"0.68\")\n", + "dot.edge(\"Growth\", \"Stagnation\", label=\"0.12\")\n", + "dot.edge(\"Growth\", \"Collapse\", label=\"0.20\")\n", + "\n", + "dot.edge(\"Stagnation\", \"Stagnation\", label=\"0.24\")\n", + "dot.edge(\"Stagnation\", \"Growth\", label=\"0.50\")\n", + "dot.edge(\"Stagnation\", \"Collapse\", label=\"0.26\")\n", + "\n", + "dot.edge(\"Collapse\", \"Collapse\", label=\"0.46\")\n", + "dot.edge(\"Collapse\", \"Stagnation\", label=\"0.18\")\n", + "dot.edge(\"Collapse\", \"Growth\", label=\"0.36\")\n", + "\n", + "dot\n", + "\n", + "dot.render(filename='Temple')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7aca758c-e819-4d01-a2aa-c5fd36f0e2ad", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/lectures/_static/lecture_specific/markov_chains_II/Irre_1 b/lectures/_static/lecture_specific/markov_chains_II/Irre_1 new file mode 100644 index 00000000..5828da69 --- /dev/null +++ b/lectures/_static/lecture_specific/markov_chains_II/Irre_1 @@ -0,0 +1,14 @@ +digraph { + rankdir=LR + poor + "middle class" + rich + poor -> poor [label=0.9] + poor -> "middle class" [label=0.1] + "middle class" -> poor [label=0.4] + "middle class" -> "middle class" [label=0.4] + "middle class" -> rich [label=0.2] + rich -> poor [label=0.1] + rich -> "middle class" [label=0.1] + rich -> rich [label=0.8] +} diff --git a/lectures/_static/lecture_specific/markov_chains_II/Irre_1.png b/lectures/_static/lecture_specific/markov_chains_II/Irre_1.png index a8eaf072..5510b4d7 100644 Binary files a/lectures/_static/lecture_specific/markov_chains_II/Irre_1.png and b/lectures/_static/lecture_specific/markov_chains_II/Irre_1.png differ diff --git a/lectures/_static/lecture_specific/markov_chains_II/Irre_2 b/lectures/_static/lecture_specific/markov_chains_II/Irre_2 new file mode 100644 index 00000000..0dc87c90 --- /dev/null +++ b/lectures/_static/lecture_specific/markov_chains_II/Irre_2 @@ -0,0 +1,12 @@ +digraph { + rankdir=LR + poor + "middle class" + rich + poor -> poor [label=1.0] + "middle class" -> poor [label=0.1] + "middle class" -> "middle class" [label=0.8] + "middle class" -> rich [label=0.1] + rich -> "middle class" [label=0.2] + rich -> rich [label=0.8] +} diff --git a/lectures/_static/lecture_specific/markov_chains_II/Irre_2.png b/lectures/_static/lecture_specific/markov_chains_II/Irre_2.png index 504a3064..2661a247 100644 Binary files a/lectures/_static/lecture_specific/markov_chains_II/Irre_2.png and b/lectures/_static/lecture_specific/markov_chains_II/Irre_2.png differ diff --git a/lectures/_static/lecture_specific/markov_chains_II/example4 b/lectures/_static/lecture_specific/markov_chains_II/example4 new file mode 100644 index 00000000..bd512c73 --- /dev/null +++ b/lectures/_static/lecture_specific/markov_chains_II/example4 @@ -0,0 +1,7 @@ +digraph { + rankdir=LR + 0 + 1 + 0 -> 1 [label=1.0] + 1 -> 0 [label=1.0] +} diff --git a/lectures/_static/lecture_specific/markov_chains_II/figures.ipynb b/lectures/_static/lecture_specific/markov_chains_II/figures.ipynb new file mode 100644 index 00000000..8f80f1db --- /dev/null +++ b/lectures/_static/lecture_specific/markov_chains_II/figures.ipynb @@ -0,0 +1,191 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "b5a640be-e2e4-4841-bcda-95f6660fd9fe", + "metadata": {}, + "source": [ + "# Figures for Markov Chain II" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "f8a64d7b-2ffd-4974-a1dd-ec14d8e44102", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Collecting graphviz\n", + " Using cached graphviz-0.20.3-py3-none-any.whl.metadata (12 kB)\n", + "Using cached graphviz-0.20.3-py3-none-any.whl (47 kB)\n", + "Installing collected packages: graphviz\n", + "Successfully installed graphviz-0.20.3\n" + ] + } + ], + "source": [ + "!pip install graphviz" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "43d55bea-fd00-4583-8d89-830151b6c36c", + "metadata": {}, + "outputs": [], + "source": [ + "from graphviz import Digraph" + ] + }, + { + "cell_type": "markdown", + "id": "4185ae75-3a1c-4f89-ad74-1950d344ba56", + "metadata": {}, + "source": [ + "## Irreducibility" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "53a8bb26-a6e8-421c-abcc-535031d5a69b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Irre_1.png'" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png')\n", + "dot.attr(rankdir='LR')\n", + "dot.node(\"poor\")\n", + "dot.node(\"middle class\")\n", + "dot.node(\"rich\")\n", + "\n", + "dot.edge(\"poor\", \"poor\", label=\"0.9\")\n", + "dot.edge(\"poor\", \"middle class\", label=\"0.1\")\n", + "dot.edge(\"middle class\", \"poor\", label=\"0.4\")\n", + "dot.edge(\"middle class\", \"middle class\", label=\"0.4\")\n", + "dot.edge(\"middle class\", \"rich\", label=\"0.2\")\n", + "dot.edge(\"rich\", \"poor\", label=\"0.1\")\n", + "dot.edge(\"rich\", \"middle class\", label=\"0.1\")\n", + "dot.edge(\"rich\", \"rich\", label=\"0.8\")\n", + "\n", + "dot\n", + "dot.render(filename='Irre_1')" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "4e96fd64-a1ab-4a6e-a5d6-a64767f6181e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Irre_2.png'" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png')\n", + "dot.attr(rankdir='LR')\n", + "dot.node(\"poor\")\n", + "dot.node(\"middle class\")\n", + "dot.node(\"rich\")\n", + "\n", + "dot.edge(\"poor\", \"poor\", label=\"1.0\")\n", + "dot.edge(\"middle class\", \"poor\", label=\"0.1\")\n", + "dot.edge(\"middle class\", \"middle class\", label=\"0.8\")\n", + "dot.edge(\"middle class\", \"rich\", label=\"0.1\")\n", + "dot.edge(\"rich\", \"middle class\", label=\"0.2\")\n", + "dot.edge(\"rich\", \"rich\", label=\"0.8\")\n", + "\n", + "dot\n", + "dot.render(filename='Irre_2')" + ] + }, + { + "cell_type": "markdown", + "id": "1d7441a9-7753-4922-8276-3d26a26798cf", + "metadata": {}, + "source": [ + "## Example 4" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "850376db-6922-4440-af89-c50b0e6b5050", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'example4.png'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png')\n", + "dot.attr(rankdir='LR')\n", + "dot.node(\"0\")\n", + "dot.node(\"1\")\n", + "\n", + "dot.edge(\"0\", \"1\", label=\"1.0\")\n", + "dot.edge(\"1\", \"0\", label=\"1.0\")\n", + "\n", + "dot\n", + "dot.render(filename='example4')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5f9c4db0-812a-4131-803f-024ae5b61772", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/lectures/_static/lecture_specific/networks/figures.ipynb b/lectures/_static/lecture_specific/networks/figures.ipynb new file mode 100644 index 00000000..80294ae8 --- /dev/null +++ b/lectures/_static/lecture_specific/networks/figures.ipynb @@ -0,0 +1,284 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "4f255add-dde2-4452-a242-a2894610a0e8", + "metadata": {}, + "source": [ + "# Figures for Networks" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "59d90e63-793c-41b0-8e52-3fce04b007e9", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: graphviz in /Users/mmcky/anaconda3/envs/quantecon/lib/python3.11/site-packages (0.20.3)\n" + ] + } + ], + "source": [ + "!pip install graphviz" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "56974a99-d93c-4e03-b9b4-99a6259dfd9b", + "metadata": {}, + "outputs": [], + "source": [ + "from graphviz import Digraph" + ] + }, + { + "cell_type": "markdown", + "id": "79c35279-6a32-43cf-b7ee-ef955a962080", + "metadata": {}, + "source": [ + "## Markov chains" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "a6cd7b6c-55a6-4e7f-a464-76d3514ad6cc", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'mc.png'" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png')\n", + "dot.attr(rankdir='LR')\n", + "\n", + "dot.node(\"ng\")\n", + "dot.node(\"mr\")\n", + "dot.node(\"sr\")\n", + "\n", + "dot.edge(\"ng\", \"ng\", label=\"0.971\")\n", + "dot.edge(\"ng\", \"mr\", label=\"0.029\")\n", + "dot.edge(\"mr\", \"ng\", label=\"0.145\")\n", + "dot.edge(\"mr\", \"mr\", label=\"0.778\")\n", + "dot.edge(\"mr\", \"sr\", label=\"0.077\")\n", + "dot.edge(\"sr\", \"mr\", label=\"0.508\")\n", + "dot.edge(\"sr\", \"sr\", label=\"0.492\")\n", + "\n", + "dot\n", + "dot.render(filename='mc')" + ] + }, + { + "cell_type": "markdown", + "id": "53ffff16-f367-45f1-9e8f-0964cde5c8e9", + "metadata": {}, + "source": [ + "## Poverty trap" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "306687a2-a76d-43ce-afb2-83380cccf258", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'poverty_trap_1.png'" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png',engine = \"neato\")\n", + "dot.attr(rankdir='LR')\n", + "dot.node(\"poor\", pos='0,0!')\n", + "dot.node(\"middle class\", pos='2,1!')\n", + "dot.node(\"rich\", pos='4,0!')\n", + "\n", + "dot.edge(\"poor\", \"poor\")\n", + "dot.edge(\"poor\", \"middle class\")\n", + "dot.edge(\"middle class\", \"poor\")\n", + "dot.edge(\"middle class\", \"middle class\")\n", + "dot.edge(\"middle class\", \"rich\")\n", + "dot.edge(\"rich\", \"poor\")\n", + "dot.edge(\"rich\", \"middle class\")\n", + "dot.edge(\"rich\", \"rich\")\n", + "\n", + "dot\n", + "dot.render(filename='poverty_trap_1')" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "599034ae-48c3-4fdb-bcbb-e13b054e7ff0", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'poverty_trap_2.png'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png',engine=\"neato\")\n", + "dot.attr(rankdir='LR')\n", + "dot.node(\"poor\", pos='0,0!')\n", + "dot.node(\"middle class\", pos='2,1!')\n", + "dot.node(\"rich\", pos='4,0!')\n", + "\n", + "dot.edge(\"poor\", \"poor\")\n", + "dot.edge(\"middle class\", \"poor\")\n", + "dot.edge(\"middle class\", \"middle class\")\n", + "dot.edge(\"middle class\", \"rich\")\n", + "dot.edge(\"rich\", \"poor\")\n", + "dot.edge(\"rich\", \"middle class\")\n", + "dot.edge(\"rich\", \"rich\")\n", + "\n", + "dot\n", + "dot.render(filename='poverty_trap_2')" + ] + }, + { + "cell_type": "markdown", + "id": "78888c53-c5f2-4766-9943-321cc91cb9af", + "metadata": {}, + "source": [ + "## Weighted directed graph" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "3aa21b51-3b55-4d31-ad0c-880e896b7a48", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'weighted.png'" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png')\n", + "\n", + "dot.attr(rankdir='LR')\n", + "dot.node(\"poor\")\n", + "dot.node(\"middle class\")\n", + "dot.node(\"rich\")\n", + "\n", + "dot.edge(\"poor\", \"poor\", label='0.9')\n", + "dot.edge(\"poor\", \"middle class\", label='0.1')\n", + "dot.edge(\"middle class\", \"poor\", label='0.4')\n", + "dot.edge(\"middle class\", \"middle class\", label='0.4')\n", + "dot.edge(\"middle class\", \"rich\", label='0.2')\n", + "dot.edge(\"rich\", \"poor\", label='0.1')\n", + "dot.edge(\"rich\", \"middle class\", label='0.1')\n", + "dot.edge(\"rich\", \"rich\", label='0.8')\n", + "\n", + "dot\n", + "dot.render(filename='weighted')" + ] + }, + { + "cell_type": "markdown", + "id": "e51acec4-a10b-4b9b-a757-835acff0d965", + "metadata": {}, + "source": [ + "## Properties" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "a88964ae-0fed-4e07-b075-1db97fbfb5f3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'properties.png'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dot = Digraph(format='png')\n", + "\n", + "dot.attr(rankdir='LR')\n", + "dot.node('1')\n", + "dot.node('2')\n", + "dot.node('3')\n", + "\n", + "dot.edge('1', '2', label='0.7')\n", + "dot.edge('1', '3', label='0.3')\n", + "dot.edge('2', '1', label='1')\n", + "dot.edge('3', '1', label='0.4')\n", + "dot.edge('3', '2', label='0.6')\n", + "\n", + "dot\n", + "dot.render(filename='properties')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8e6703ea-321a-47d8-b4c8-9f4013e699df", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/lectures/_static/lecture_specific/networks/mc b/lectures/_static/lecture_specific/networks/mc new file mode 100644 index 00000000..ca9ddc78 --- /dev/null +++ b/lectures/_static/lecture_specific/networks/mc @@ -0,0 +1,13 @@ +digraph { + rankdir=LR + ng + mr + sr + ng -> ng [label=0.971] + ng -> mr [label=0.029] + mr -> ng [label=0.145] + mr -> mr [label=0.778] + mr -> sr [label=0.077] + sr -> mr [label=0.508] + sr -> sr [label=0.492] +} diff --git a/lectures/_static/lecture_specific/networks/mc.png b/lectures/_static/lecture_specific/networks/mc.png index 774b4092..caeccf2b 100644 Binary files a/lectures/_static/lecture_specific/networks/mc.png and b/lectures/_static/lecture_specific/networks/mc.png differ diff --git a/lectures/_static/lecture_specific/networks/poverty_trap_1 b/lectures/_static/lecture_specific/networks/poverty_trap_1 new file mode 100644 index 00000000..5c89dba8 --- /dev/null +++ b/lectures/_static/lecture_specific/networks/poverty_trap_1 @@ -0,0 +1,14 @@ +digraph { + rankdir=LR + poor [pos="0,0!"] + "middle class" [pos="2,1!"] + rich [pos="4,0!"] + poor -> poor + poor -> "middle class" + "middle class" -> poor + "middle class" -> "middle class" + "middle class" -> rich + rich -> poor + rich -> "middle class" + rich -> rich +} diff --git a/lectures/_static/lecture_specific/networks/poverty_trap_1.png b/lectures/_static/lecture_specific/networks/poverty_trap_1.png index 892162c3..e3bda2a6 100644 Binary files a/lectures/_static/lecture_specific/networks/poverty_trap_1.png and b/lectures/_static/lecture_specific/networks/poverty_trap_1.png differ diff --git a/lectures/_static/lecture_specific/networks/poverty_trap_2 b/lectures/_static/lecture_specific/networks/poverty_trap_2 new file mode 100644 index 00000000..c42f3f35 --- /dev/null +++ b/lectures/_static/lecture_specific/networks/poverty_trap_2 @@ -0,0 +1,13 @@ +digraph { + rankdir=LR + poor [pos="0,0!"] + "middle class" [pos="2,1!"] + rich [pos="4,0!"] + poor -> poor + "middle class" -> poor + "middle class" -> "middle class" + "middle class" -> rich + rich -> poor + rich -> "middle class" + rich -> rich +} diff --git a/lectures/_static/lecture_specific/networks/poverty_trap_2.png b/lectures/_static/lecture_specific/networks/poverty_trap_2.png index 8d7f9fa2..71f2d31b 100644 Binary files a/lectures/_static/lecture_specific/networks/poverty_trap_2.png and b/lectures/_static/lecture_specific/networks/poverty_trap_2.png differ diff --git a/lectures/_static/lecture_specific/networks/properties b/lectures/_static/lecture_specific/networks/properties new file mode 100644 index 00000000..8084a013 --- /dev/null +++ b/lectures/_static/lecture_specific/networks/properties @@ -0,0 +1,11 @@ +digraph { + rankdir=LR + 1 + 2 + 3 + 1 -> 2 [label=0.7] + 1 -> 3 [label=0.3] + 2 -> 1 [label=1] + 3 -> 1 [label=0.4] + 3 -> 2 [label=0.6] +} diff --git a/lectures/_static/lecture_specific/networks/properties.png b/lectures/_static/lecture_specific/networks/properties.png index db717df6..70986889 100644 Binary files a/lectures/_static/lecture_specific/networks/properties.png and b/lectures/_static/lecture_specific/networks/properties.png differ diff --git a/lectures/_static/lecture_specific/networks/weighted b/lectures/_static/lecture_specific/networks/weighted new file mode 100644 index 00000000..5828da69 --- /dev/null +++ b/lectures/_static/lecture_specific/networks/weighted @@ -0,0 +1,14 @@ +digraph { + rankdir=LR + poor + "middle class" + rich + poor -> poor [label=0.9] + poor -> "middle class" [label=0.1] + "middle class" -> poor [label=0.4] + "middle class" -> "middle class" [label=0.4] + "middle class" -> rich [label=0.2] + rich -> poor [label=0.1] + rich -> "middle class" [label=0.1] + rich -> rich [label=0.8] +} diff --git a/lectures/_static/lecture_specific/networks/weighted.png b/lectures/_static/lecture_specific/networks/weighted.png index a8eaf072..5510b4d7 100644 Binary files a/lectures/_static/lecture_specific/networks/weighted.png and b/lectures/_static/lecture_specific/networks/weighted.png differ