Last active
August 29, 2015 14:21
-
-
Save kenjisato/08439241d90756a5248c to your computer and use it in GitHub Desktop.
2015 経済動学 講義資料 (2015/05/25)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"# ラムゼーモデルの局所動学\n", | |
"\n", | |
"### 経済動学 講義資料\n", | |
"\n", | |
"神戸大学 佐藤健治\n", | |
"\n", | |
"2015-5-25\n", | |
"\n", | |
"https://bitbucket.org/kenjisato/economic_dynamics\n", | |
"\n", | |
"See https://bitbucket.org/kenjisato/economic_dynamics/src/0230a3f1c5b7075b77e9a23611e56d743bbbc903/Codes/2015-05-25/?at=master" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": true, | |
"slideshow": { | |
"slide_type": "skip" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"%matplotlib inline" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"## 目標\n", | |
"\n", | |
"1部門モデルを考える. \n", | |
"\n", | |
"生産関数と効用関数を特定化して、オイラー条件\n", | |
"\n", | |
"\\begin{align}\n", | |
" u_2(k_{t-1}, k_t) + \\rho u_1(k_t, k_{t+1}) = 0\n", | |
"\\end{align}\n", | |
"\n", | |
"によって定まる力学系を可視化したい\n", | |
"\n", | |
"3つのプログラミング・パラダイム\n", | |
"\n", | |
"1. 手続き型\n", | |
"1. オブジェクト指向\n", | |
"1. [Optional] 関数型" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"## 手続き型 (素朴な方法)\n", | |
"\n", | |
"### パラメータ" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"## Unicode identifiers are only valid in Python3\n", | |
"## In Python2, use less readable notation such as\n", | |
"# alpha = 0.4\n", | |
"# rho = 0.9\n", | |
"\n", | |
"A = 1.1 \n", | |
"α = 0.4\n", | |
"ρ = 0.9 " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"collapsed": true, | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### 生産関数 \n", | |
"\\begin{align}\n", | |
" f(k) = Ak^\\alpha\n", | |
"\\end{align}" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def f(k):\n", | |
" return A * k ** α" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### 消費の効用関数\n", | |
"\n", | |
"\\begin{align}\n", | |
" U(c) = \\log c\n", | |
"\\end{align}" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"from math import log\n", | |
"\n", | |
"def U(c):\n", | |
" return log(c)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### 規約型効用関数\n", | |
"\n", | |
"\\begin{align}\n", | |
" u(x, y) = U(f(x) - y)\n", | |
"\\end{align}" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def u(x, y):\n", | |
" return U(f(x) - y)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### オイラー条件\n", | |
"\n", | |
"\\begin{align}\n", | |
" u_2(k_{t-1}, k_t) = \\frac{-1}{Ak_{t-1}^\\alpha - k_t}\\\\\n", | |
" u_1(k_t, k_{t+1}) = \\frac{\\alpha A k_t^{\\alpha - 1}}{Ak_t^\\alpha - k_{t+1}}\n", | |
"\\end{align}\n", | |
"\n", | |
"より\n", | |
"\n", | |
"\\begin{align}\n", | |
" k_{t+1} = F(k_{t-1}, k_t) = (1+\\rho \\alpha) A k_t^\\alpha - \\rho \\alpha A^2 k_{t-1}^\\alpha k_t^{\\alpha-1}\n", | |
"\\end{align}" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def F(x, y):\n", | |
" return ((1 + ρ * α) * A * y ** α \n", | |
" - ρ * α * (A ** 2) * (x ** α) * (y ** (α - 1)))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### 相空間上の力学系" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def G(x):\n", | |
" return [\n", | |
" x[1],\n", | |
" F(x[0], x[1])\n", | |
" ]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### シミュレーション" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[0.8, 0.43]\n", | |
"[0.43, 0.4063168783383537]\n", | |
"[0.4063168783383537, 0.509937247085211]\n", | |
"[0.509937247085211, 0.6875981937381642]\n" | |
] | |
} | |
], | |
"source": [ | |
"duration = 4\n", | |
"x0 = [0.8, 0.43]\n", | |
"\n", | |
"x = x0[:]\n", | |
"for t in range(duration):\n", | |
" print(x)\n", | |
" x = G(x)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"以上をまとめたものが listing01.py" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"#!/usr/bin/env python3\r\n", | |
"\r\n", | |
"from math import log\r\n", | |
"\r\n", | |
"## Unicode identifiers are only valid in Python3\r\n", | |
"## In Python2, use less readable notation such as\r\n", | |
"# alpha = 0.4\r\n", | |
"# rho = 0.9\r\n", | |
"\r\n", | |
"A = 1.1\r\n", | |
"α = 0.4\r\n", | |
"ρ = 0.9\r\n", | |
"\r\n", | |
"\r\n", | |
"def f(k):\r\n", | |
" \"\"\"Production function\"\"\"\r\n", | |
" return A * k ** α\r\n", | |
"\r\n", | |
"\r\n", | |
"def U(c):\r\n", | |
" \"\"\"Utility function\"\"\"\r\n", | |
" return log(c)\r\n", | |
"\r\n", | |
"def u(x, y):\r\n", | |
" \"\"\"Reduced form utility function\"\"\"\r\n", | |
" return U(f(x) - y)\r\n", | |
"\r\n", | |
"\r\n", | |
"def F(x, y):\r\n", | |
" \"\"\"Solution of Euler equation\"\"\"\r\n", | |
" return ((1 + ρ * α) * A * y ** α\r\n", | |
" - ρ * α * (A ** 2) * (x ** α) * (y ** (α - 1)))\r\n", | |
"\r\n", | |
"\r\n", | |
"def G(x):\r\n", | |
" \"\"\"Dynamical system\"\"\"\r\n", | |
" return [\r\n", | |
" x[1],\r\n", | |
" F(x[0], x[1])\r\n", | |
" ]\r\n", | |
"\r\n", | |
"if __name__ == \"__main__\":\r\n", | |
"\r\n", | |
" duration = 4\r\n", | |
" x0 = [0.8, 0.43]\r\n", | |
"\r\n", | |
" x = x0[:]\r\n", | |
" for t in range(duration):\r\n", | |
" print(x)\r\n", | |
" x = G(x)\r\n" | |
] | |
} | |
], | |
"source": [ | |
"%cat listing01.py" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### 補足\n", | |
"\n", | |
" if __name__ == \"_main__\":\n", | |
" [do something]\n", | |
" \n", | |
" \n", | |
"これはPythonのイディオムで、 `import`文で呼び出された場合には実行されずに、`run` で呼び出された場合には実行されます. " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### 可視化の基本" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEACAYAAACnJV25AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGgRJREFUeJzt3XuUXWV9xvHvkxBEsIgaiZgEg4JcxIRLSWhQGOQ2CeWq\nFQNIAREqjbW0BbysQlZpbbWLii6WGFNu1QqooHIzEQpTaZpQaEmAmmAiILlJBdFapTaRX/94d2QY\nZuZcZp+zL+f5rHWWc+Zs9vntlfDw+tvv+25FBGZmVh/jii7AzMzy5WA3M6sZB7uZWc042M3MasbB\nbmZWMw52M7OaaRjskq6R9LSkR0b4/DRJKyU9LGmppOn5l2lmZs1qZsR+LdA/yuePA4dGxHTgMuCL\neRRmZmbtaRjsEXEf8Nwony+LiJ9lb+8HpuRUm5mZtSHvHvsHgDtzPqeZmbVgm7xOJOlw4GzgkLzO\naWZmrcsl2LMbpouA/ogYtm0jyZvSmJm1ISLUyvFjDnZJuwK3AKdHxNrRjm21uCqRtCAiFhRdR6fU\n+frqfG3g66u6dgbFD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uZWc042M3MasbBbmZWMw52M7Oa\ncbCbmdXM/wN2vHdz0f3yIAAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x108221a90>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# listing02.py\n", | |
"\n", | |
"import numpy as np\n", | |
"import matplotlib.pyplot as plt # プロッティング・ライブラリを読み込む\n", | |
"from listing01 import f\n", | |
"\n", | |
"fig = plt.figure()\n", | |
"ax = fig.add_subplot(111) # 作図領域の作成\n", | |
"\n", | |
"grids = np.linspace(0.0, 1.2, 120)\n", | |
"ax.plot(grids, f(grids))\n", | |
"\n", | |
"plt.show() # 図の表示" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### 軌道の可視化" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"collapsed": false, | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEACAYAAACnJV25AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHiVJREFUeJzt3X2YVXW99/H3R4QYJbKioQTMOWCmEKYmlHZsTC0Yj2jW\nyXzIo6Z5KqBjh7SH+1auOqcnqAS8jhmpWeekVvaARZDdNncdE7P7iIqhAWI8aE6a+dQmIb/3H7+F\nDsPM7D0ze++1Hz6v6+KSvfeatb/rAj/+/K7f77cUEZiZWePYI+8CzMysvBzsZmYNxsFuZtZgHOxm\nZg3GwW5m1mAc7GZmDaZosEu6WtIjku7p4/MzJN0l6W5Jt0qaWv4yzcysVKWM2K8BZvTz+QPA0REx\nFfg08NVyFGZmZoNTNNgj4pfA4/18fltEPJG9vB0YX6bazMxsEMrdY38fsLzM5zQzswHYs1wnknQM\ncC5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v9zrGWlXN9w\n4DDgWGAv4DZJqyJiXUUrK49Sru8TwOqIaJc0EbhZ0iER8VSFa6uWes2VkpWaK+UO9rIuaKpBpVwf\n2Y2NpcCMiOjvfx9rSSnXdjhpvQKkHu1MSdsjYll1ShySUq5vM/BoRBSAgqRfAIcA9RDspVzfkcC/\nA0TEBkkbgQNJ61XqXT3nSkkGkivlbsU8v6BJ0gjSgqae/9IvA87KCu1zQVONKnp9kvYDvgecGRHr\nc6hxsIpeW0T8XUS0RUQbqc/+gToJdSjt7+YPgTdLGiZpL9JNuN9Wuc7BKuX67gOOA8j6zwcCD1S1\nysqp51wpaqC5UtYRezT4gqZSrg+4BHgpcEU2st0eEdPyqrlUJV5b3Srx7+Z9klYAdwPPAUsjoi6C\nvcQ/v88A10i6izSouygi6uKpZpKuA94CjJG0GbiU1Dqr+1yB4tfHAHPFC5TMzBpMtZ95amZmFeZg\nNzNrMA52M7MG42A3M2swDnYzswbjYDczazAOdjOzBuNgNzNrMP8f5DmIw0g6nr0AAAAASUVORK5C\nYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x108250048>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# listing03.py\n", | |
"\n", | |
"import matplotlib.pyplot as plt\n", | |
"from listing01 import f, G\n", | |
"\n", | |
"duration = 10\n", | |
"x0 = [0.8, 0.43]\n", | |
"\n", | |
"fig = plt.figure()\n", | |
"ax = fig.add_subplot(111)\n", | |
"\n", | |
"grids = np.linspace(0.0, 1.2, 120)\n", | |
"ax.plot(grids, f(grids))\n", | |
"\n", | |
"x = x0[:]\n", | |
"for t in range(duration):\n", | |
" ax.plot(x[0], x[1], marker='o', linestyle='')\n", | |
" x = G(x)\n", | |
" \n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"これでは動きが分からない .... " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"collapsed": false, | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQcAAAEACAYAAAC+rrMfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH55JREFUeJzt3XmUXFW5/vHv050ECBASCAQIIQkkMgcRCIMgYVDDIFzh\nJxBEmWRQUZxxJFFUFNHLYsFlBrnKoKJXAQOCYgSZFJFAZJAAQSAMEgaBkJB0P78/9mnodCpd1dVV\ndU51vZ+1enWfrl3nvOlUvbX3PnuQbUIIoae2vAMIIRRTJIcQQkmRHEIIJUVyCCGUFMkhhFBSJIcQ\nQkllk4OkSyQ9J+n+FTz+YUmzJd0n6TZJk2ofZgih0SqpOVwKTO3l8ceA99ieBJwKXFCLwEII+Sqb\nHGzfCrzUy+N32H4lO7wL2KBGsYUQclTrPodjgJk1PmcIIQeDanUiSbsDRwPvrtU5Qwj5qUlyyDoh\nLwSm2i7ZBJEUkzhCyIlt9fU5/U4OkjYEfgUcbntub2WrCbCeJM2wPSPvOLorYkxQzLgipspU+8Fc\nNjlIuhLYDRgp6UlgOjAYwPb5wCnACOBcSQBLbE+uJpgQQu1IbAEcW+3zyyYH29PKPP4x4GPVBhBC\nqB2JocDBpKQwjjQUoSqtPkJyVt4BlDAr7wBWYFbeAZQwK+8ASpjV6AtKGiJd/l7pX1eAnwQ+BHwf\nGGvz9arP26jFXiS5aH0OITQTSYLBp8BqW0HbeBi0AbxvHTgBGGt4/n9hm1Ns/tXjeVW992p2KzOE\nUD9S++dgrcPhzU1hj1VgF+Bw4C/A6cBt29n/vqeW14zkEEKBSWoD1oPVVoIDJsFx7TAWuATYDnju\nFVi0re1Ha33tSA4hFJCkY2H16TB+FHwSOKId5gh+BNwBrAUseAIW7Wj72XrEEMkhhIKRaIPfL4bX\n14d9Be3AVZ1w5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ai/1UqThAwPLxVTNa7zWyaGIg6Yqiam7Y4CZdYwHKohJ0mjS\nG6FrOHq9O4cq+TtNBNaU9EdJd0v6SAFiuhDYQtJ8YDZwUp1jqkTRBwZW9Bovdyuzr4o4aKric0va\nHTgaeHf9wgEqi+lM4Mu2LUks/zfLI6bBwLuAPYGhwB2S7rT9SI4xfRW41/YUSRsDN0na2vardYqp\nUoUcGNiX13itk0NNB001MCayDpoLgam2e6syNiqmbUljRyC1pfeWtMT2NTnG9CTwgu03gDck3QJs\nDdQrOVQS087AdwBsPyrpcWAT0hidvDT6NV6RPr/Ga9wpMgh4lNSBNITyHZI7Uv/Ov0pi2pDU8bVj\nvTuOKo2pR/lLgQPzjgnYFPg9qaNwKHA/sHnOMf0ImJ79PIqUPNZswP/hOCrrkKz7a7zCmPr8Gq9p\nzcEFHDRVSUzAKcAI4Nzsk3qJ7ck5x9RQFf7fPSTpBuA+oBO40PYDecYEfBe4VNJsUh/al2y/WK+Y\nACRdCewGjJT0JDCd1OTK5TVeSUxU8RqPQVAhhJJimbgQQkmRHEIIJUVyCCGUFMkhhFBSJIcQQkmR\nHEIIJUVyCCGUFMkhhFDS/wfEYiTLwh5xBwAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x108416ba8>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# listing04.py\n", | |
"\n", | |
"import numpy as np\n", | |
"import matplotlib.pyplot as plt\n", | |
"from listing01 import f, G\n", | |
"\n", | |
"duration = 10\n", | |
"x0 = [0.8, 0.43]\n", | |
"\n", | |
"fig = plt.figure()\n", | |
"ax = fig.add_subplot(111, aspect='equal')\n", | |
"\n", | |
"grids = np.linspace(0.0, 1.2, 120)\n", | |
"ax.plot(grids, f(grids))\n", | |
"\n", | |
"\n", | |
"x = x0[:]\n", | |
"for t in range(duration):\n", | |
" x1 = G(x)\n", | |
" dx = [x1[0] - x[0], x1[1] - x[1]]\n", | |
" ax.plot(x[0], x[1], marker='', linestyle='', color='black')\n", | |
" ax.arrow(x[0], x[1], dx[0], dx[1], length_includes_head=True)\n", | |
" x = x1\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"\n", | |
"## OOP\n", | |
"\n", | |
"対象と動作をまとめてやる. たとえば次のような記法でシミュレーションができるようにしたい. \n", | |
"\n", | |
" >>> ramsey = Ramsey(A=1.1, α=0.4, ρ=0.9)\n", | |
" >>> sim = Simulation(ramsey, x0=[0.8, 0.43], duration=5)\n", | |
" >>> path = [x for x in sim]\n", | |
" >>> path\n", | |
" [[0.8, 0.43],\n", | |
" [0.43, 0.4063168783383537],\n", | |
" [0.4063168783383537, 0.5099372470852112],\n", | |
" [0.5099372470852112, 0.6875981937381646],\n", | |
" [0.6875981937381646, 0.8712750948974344]]\n", | |
" " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": { | |
"collapsed": true, | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"# listing05.py の一部\n", | |
"\n", | |
"class Ramsey:\n", | |
" \"\"\"One-sector Ramsey model\"\"\"\n", | |
"\n", | |
" def __init__(self, A, α, ρ):\n", | |
" self.A = A\n", | |
" self.α = α\n", | |
" self.ρ = ρ\n", | |
"\n", | |
" def f(self, x):\n", | |
" return self.A * x ** self.α\n", | |
"\n", | |
" def U(self, x):\n", | |
" return log(x)\n", | |
"\n", | |
" def u(self, x, y):\n", | |
" return self.U(self.f(x) - y)\n", | |
"\n", | |
" def forward(self, x):\n", | |
" \"\"\"1ステップの時間発展\"\"\"\n", | |
" A, α, ρ = self.A, self.α, self.ρ\n", | |
" return [\n", | |
" x[1],\n", | |
" (1 + ρ * α) * A * x[1] ** α - ρ * α * (A ** 2) * (x[1] ** (α - 1)) * (x[0] ** α)\n", | |
" ]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": { | |
"collapsed": true, | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"# listing05.py の一部\n", | |
"\n", | |
"class Simulation:\n", | |
" \"\"\"Simulation of a dynamical system\"\"\"\n", | |
"\n", | |
" def __init__(self, sys, x0, duration):\n", | |
" self.sys = sys\n", | |
" self.x0 = x0\n", | |
" self.duration = duration\n", | |
"\n", | |
" def __iter__(self):\n", | |
" x = self.x0[:]\n", | |
" for _ in range(self.duration):\n", | |
" yield x\n", | |
" x = self.sys.forward(x)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": { | |
"collapsed": false, | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[[0.8, 0.43],\n", | |
" [0.43, 0.4063168783383537],\n", | |
" [0.4063168783383537, 0.5099372470852112],\n", | |
" [0.5099372470852112, 0.6875981937381646],\n", | |
" [0.6875981937381646, 0.8712750948974344]]" | |
] | |
}, | |
"execution_count": 15, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"ramsey = Ramsey(A=1.1, α=0.4, ρ=0.9)\n", | |
"sim = Simulation(ramsey, x0=[0.8, 0.43], duration=5)\n", | |
"\n", | |
"path = [x for x in sim]\n", | |
"path" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 16, | |
"metadata": { | |
"collapsed": false, | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQcAAAEACAYAAAC+rrMfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH41JREFUeJzt3XmYXFW57/HvrzsJECAkEAwQAgESmSSIQJilGTyGQbjC\nFQiiTDKoKA5HcSRRVFTQw8OF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zlUEtPOwLcBbP9T0qPA\npqQxOnlp9Gu8Iv1+jde4U2QI8E9SB9IwyndI7kj9O/8qiWkDUsfXjvXuOKo0pl7lLwUOyjsmYDPg\n96SOwuHA/cAWOcf0Q2Ba9vMYUvJYswH/h+OprEOy7q/xCmPq92u8pjUHF3DQVCUxAacCo4AZ2Sf1\nEtuTc46poSr8v5sr6XrgPqALuND2A3nGBHwHuFTSbFIf2hdtP1+vmAAkXQHsDoyW9DgwjdTkyuU1\nXklMVPEaj0FQIYSSYpm4EEJJkRxCCCVFcgghlBTJIYRQUiSHEEJJkRxCCCVFcgghlBTJIYRQ0v8C\nWPY0HuAQTe0AAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x1085cbc88>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# listing05.py の一部\n", | |
"\n", | |
"ramsey = Ramsey(A=1.1, α=0.4, ρ=0.9)\n", | |
"sim = Simulation(ramsey, x0=[0.8, 0.43], duration=10)\n", | |
"\n", | |
"fig, ax = plt.subplots(subplot_kw={'aspect':'equal'})\n", | |
"\n", | |
"grids = np.linspace(0.0, 1.2, 120)\n", | |
"ax.plot(grids, ramsey.f(grids))\n", | |
"\n", | |
"for i, x in enumerate(sim):\n", | |
" if i == 0:\n", | |
" ax.plot(x[0], x[1], marker='', linestyle='', color='black')\n", | |
" else: \n", | |
" dx = [x[0] - x0[0], x[1] - x0[1]]\n", | |
" ax.plot(x[0], x[1], marker='', linestyle='', color='black')\n", | |
" ax.arrow(x0[0], x0[1], dx[0], dx[1], length_includes_head=True) \n", | |
" x0 = x[:]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"初期値を変えてシミュレーションしたものを重ねることも簡単にできる. `Simulation` クラスを書き換える. " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 17, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# listing06.py の一部\n", | |
"\n", | |
"class Simulation:\n", | |
" \"\"\"__init__ と __iter__ は変更なし\"\"\"\n", | |
"\n", | |
" def reset(self, *, x0=None, duration=None):\n", | |
" if x0 is not None:\n", | |
" self.x0 = x0[:]\n", | |
" if duration is not None:\n", | |
" self.duration = duration\n", | |
"\n", | |
" def plot(self, ax):\n", | |
" for i, x in enumerate(self):\n", | |
" if i == 0:\n", | |
" ax.plot(x[0], x[1], marker='', linestyle='', color='black')\n", | |
" else:\n", | |
" dx = [x[0] - x0[0], x[1] - x0[1]]\n", | |
" ax.plot(x[0], x[1], marker='', linestyle='', color='black')\n", | |
" ax.arrow(x0[0], x0[1], dx[0], dx[1], length_includes_head=True)\n", | |
" x0 = x[:]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 18, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQcAAAEACAYAAAC+rrMfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXmYXFXRh99f98wkmawkgUBCIEAiECBsIWwGgqCGsCoi\nm+wIiEFB+ED2VUVc4BMwYoSAyqIsYkAEQQwCQpRPCCBhCZtJQJAEyEK26a7vj3Mn00x6unt6+t7u\nman3efqZvn3PPae653Z1nTp1qmRmOI7jtCZVbQEcx6lNXDk4jpMXVw6O4+TFlYPjOHlx5eA4Tl5c\nOTiOk5eiykHSjZLelfR8G+ePkDRL0nOSnpA0pvJiOo6TNKVYDtOAiQXOvw7sZmZjgMuAn1dCMMdx\nqktR5WBmjwEfFDj/pJl9FB3OBNavkGyO41SRSvscjgfur3CfjuNUgbpKdSRpD+A4YNdK9ek4TvWo\niHKInJBTgYlmlncKIsk3cThOlTAztfeaDisHSRsAdwNfMbM5hdqWI2CcSLrYzC6uthy51KJMUJty\nu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ns4neo+XKFO77/FKWw61GDRVVCYze9LMmhPRzCT+\nOI1SPieAU4E7gf/GLE+pMh0O3GVm8wDM7P0akOkdoF/0vB+wwMya4hTKzB4DPijQJPHAwGIylXOP\nV1o51GLQVCky5XI8cH+M8kAJMkkaRvgiNIejx+0cKuVzGgUMlPQXSU9LOrIGZJoKbCHpbWAW8M2Y\nZSqFWg8MLOker3SV7VoMmiq5b0l7AMcBu8YnDlCaTFcD3zYzkyTW/MyqIVM9sB2wJ9AIPCnpKTN7\ntYoynQs8a2YTJG0CPCRpazNbHJNMpVKTgYHtuccrrRwqGjSVoExEDpqpwEQzK2QyJiXT9oTYEQhz\n6b0lrTKz6VWUaS7wvpktA5ZJ+iuwNRCXcihFpl2A7wCY2WuS3gA2JcToVIuk7/GSaPc9XmGnSB3w\nGsGB1EBxh+ROxO/8K0WmDQiOr53idhyVKlOr9tOAL1ZbJmAz4GGCo7AReB4YXWWZfgxcFD0fQlAe\nAxP4H46gNIdk7Pd4iTK1+x6vqOVgNRg0VYpMwIXAWsCU6Jd6lZmNq7JMiVLi/+4lSQ8AzwFZYKqZ\nvVhNmYDvAtMkzSL40M4ys4VxyQQg6TZgd2CwpLnARYQpV1Xu8VJkoox73IOgHMfJi6eJcxwnL64c\nHMfJiysHx3Hy4srBcZy8uHJwHCcvrhwcx8mLKwfHcfLiysFxnLz8PxbIkZvZJzhDAAAAAElFTkSu\nQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x10850a278>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%run listing06" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"初期値を決めたときに、軌道を計算・プロットする方法の説明は終わり.\n", | |
"\n", | |
"残る問題は安定多様体上の軌道をどのように計算するか?\n", | |
"\n", | |
"長期均衡に収束するような初期値をなんとか探せばよい \n", | |
"\n", | |
"あるいは、このモデルなら**長期均衡の近傍から出発する逆向きの軌道を計算する**方がスマートにできる. 生産関数と効用関数の特定化次第では逆向きの時間発展が計算できる. ヤコビアンの安定固有ベクトル方向に摂動を加えて、逆向きに時間発展させれば安定多様体上の軌道が計算できるはず " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"celltoolbar": "Slideshow", | |
"kernelspec": { | |
"display_name": "Python 3", | |
"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.4.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from math import log | |
## Unicode identifiers are only valid in Python3 | |
## In Python2, use less readable notation such as | |
# alpha = 0.4 | |
# rho = 0.9 | |
A = 1.1 | |
α = 0.4 | |
ρ = 0.9 | |
def f(k): | |
"""Production function""" | |
return A * k ** α | |
def U(c): | |
"""Utility function""" | |
return log(c) | |
def u(x, y): | |
"""Reduced form utility function""" | |
return U(f(x) - y) | |
def F(x, y): | |
"""Solution of Euler equation""" | |
return ((1 + ρ * α) * A * y ** α | |
- ρ * α * (A ** 2) * (x ** α) * (y ** (α - 1))) | |
def G(x): | |
"""Dynamical system""" | |
return [ | |
x[1], | |
F(x[0], x[1]) | |
] | |
if __name__ == "__main__": | |
duration = 4 | |
x0 = [0.8, 0.43] | |
x = x0[:] | |
for t in range(duration): | |
print(x) | |
x = G(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -* | |
import numpy as np | |
import matplotlib.pyplot as plt # プロッティング・ライブラリを読み込む | |
from listing01 import f | |
fig = plt.figure() | |
ax = fig.add_subplot(111) # 作図領域の作成 | |
grids = np.linspace(0.0, 1.2, 120) | |
ax.plot(grids, f(grids)) | |
plt.show() # 図の表示 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import matplotlib.pyplot as plt | |
from listing01 import f, G | |
duration = 10 | |
x0 = [0.8, 0.43] | |
fig = plt.figure() | |
ax = fig.add_subplot(111) | |
grids = np.linspace(0.0, 1.2, 120) | |
ax.plot(grids, f(grids)) | |
x = x0[:] | |
for t in range(duration): | |
ax.plot(x[0], x[1], marker='o', linestyle=' ') | |
x = G(x) | |
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from listing01 import f, G | |
duration = 10 | |
x0 = [0.8, 0.43] | |
fig = plt.figure() | |
ax = fig.add_subplot(111, aspect='equal') | |
grids = np.linspace(0.0, 1.2, 120) | |
ax.plot(grids, f(grids)) | |
x = x0[:] | |
for t in range(duration): | |
x1 = G(x) | |
dx = [x1[0] - x[0], x1[1] - x[1]] | |
ax.plot(x[0], x[1], marker='', linestyle=' ', color='black') | |
ax.arrow(x[0], x[1], dx[0], dx[1], length_includes_head=True) | |
x = x1 | |
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
class Ramsey: | |
"""One-sector Ramsey model""" | |
def __init__(self, A, α, ρ): | |
self.A = A | |
self.α = α | |
self.ρ = ρ | |
def f(self, x): | |
return self.A * x ** self.α | |
def U(self, x): | |
return log(x) | |
def u(self, x, y): | |
return self.U(self.f(x) - y) | |
def forward(self, x): | |
"""1ステップの時間発展""" | |
A, α, ρ = self.A, self.α, self.ρ | |
return [ | |
x[1], | |
(1 + ρ * α) * A * x[1] ** α - ρ * α * (A ** 2) * (x[1] ** (α - 1)) * (x[0] ** α) | |
] | |
class Simulation: | |
"""Simulation of a dynamical system""" | |
def __init__(self, sys, x0, duration): | |
self.sys = sys | |
self.x0 = x0 | |
self.duration = duration | |
def __iter__(self): | |
x = self.x0[:] | |
for _ in range(self.duration): | |
yield x | |
x = self.sys.forward(x) | |
if __name__ == "__main__": | |
ramsey = Ramsey(A=1.1, α=0.4, ρ=0.9) | |
sim = Simulation(ramsey, x0=[0.8, 0.43], duration=10) | |
fig, ax = plt.subplots(subplot_kw={'aspect':'equal'}) | |
grids = np.linspace(0.0, 1.2, 120) | |
ax.plot(grids, ramsey.f(grids)) | |
for i, x in enumerate(sim): | |
if i == 0: | |
ax.plot(x[0], x[1], marker='', linestyle='', color='black') | |
else: | |
dx = [x[0] - x0[0], x[1] - x0[1]] | |
ax.plot(x[0], x[1], marker='', linestyle='', color='black') | |
ax.arrow(x0[0], x0[1], dx[0], dx[1], length_includes_head=True) | |
x0 = x[:] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from collections import namedtuple | |
from listing05 import Ramsey | |
class Simulation: | |
"""Simulation of a dynamical system""" | |
def __init__(self, sys, x0=None, duration=None): | |
self.sys = sys | |
self.x0 = x0 | |
self.duration = duration | |
def __iter__(self): | |
x = self.x0[:] | |
for _ in range(self.duration): | |
yield x | |
x = self.sys.forward(x) | |
def reset(self, *, x0=None, duration=None): | |
if x0 is not None: | |
self.x0 = x0[:] | |
if duration is not None: | |
self.duration = duration | |
def plot(self, ax): | |
for i, x in enumerate(self): | |
if i == 0: | |
ax.plot(x[0], x[1], marker='', linestyle='', color='black') | |
else: | |
dx = [x[0] - x0[0], x[1] - x0[1]] | |
ax.plot(x[0], x[1], marker='', linestyle='', color='black') | |
ax.arrow(x0[0], x0[1], dx[0], dx[1], length_includes_head=True) | |
x0 = x[:] | |
if __name__ == "__main__": | |
ramsey = Ramsey(A=1.1, α=0.4, ρ=0.9) | |
sim = Simulation(ramsey) | |
SimParam = namedtuple('SimParam', ('x0', 'duration')) | |
params = [ | |
SimParam((1.2, 0.460), 10), | |
SimParam((1.2, 0.430), 10), | |
SimParam((1.2, 0.425), 6), | |
SimParam((0.05, 0.15), 10) | |
] | |
fig, ax = plt.subplots(subplot_kw={'aspect':'equal'}) | |
grids = np.linspace(0.0, 1.2, 120) | |
ax.plot(grids, ramsey.f(grids)) | |
for param in params: | |
sim.reset(x0=param.x0, duration=param.duration) | |
sim.plot(ax) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment