{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Finite Markov Chains: Examples" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Daisuke Oyama**\n", "\n", "*Faculty of Economics, University of Tokyo*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook demonstrates how to analyze finite-state Markov chains\n", "with the MarkovChain class.\n", "For basic concepts and properties on Markov chains, see\n", "\n", "* [the lecture on finite Markov chains](http://quant-econ.net/py/finite_markov.html)\n", " in Quantitative Economics, and\n", "* [the documentation for MarkovChain](http://quanteconpy.readthedocs.org/en/stable/markov/core.html).\n", "\n", "For algorithmic issues in detecting reducibility and periodicity of a Markov chain,\n", "see, for example,\n", "\n", "* J. P. Jarvis and D. R. Shier,\n", " \"[Graph-Theoretic Analysis of Finite Markov Chains](http://www.ces.clemson.edu/~shierd/Shier/markov.pdf),\"\n", "\n", "from which we draw some examples below." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from __future__ import division, print_function\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from quantecon.markov import MarkovChain" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 1: Reducible chain" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Consider the Markov chain given by the following stochastic matrix,\n", "taken from Exercise 3 in Jarvis and Shier\n", "(where the actual values of non-zero probabilities are not important):" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "P = np.zeros((6, 6))\n", "P[0, 0] = 1\n", "P[1, 4] = 1\n", "P[2, [2, 3, 4]] = 1/3\n", "P[3, [0, 5]] = 1/2\n", "P[4, [1, 4]] = 1/2\n", "P[5, [0, 3]] = 1/2" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. ]\n", " [ 0. 0. 0.33333333 0.33333333 0.33333333 0. ]\n", " [ 0.5 0. 0. 0. 0. 0.5 ]\n", " [ 0. 0.5 0. 0. 0.5 0. ]\n", " [ 0.5 0. 0. 0.5 0. 0. ]]\n" ] } ], "source": [ "print(P)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a MarkovChain instance:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [], "source": [ "mc1 = MarkovChain(P)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Classification of states" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This Markov chain is reducible:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.is_irreducible" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "4" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.num_communication_classes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Determine the communication classes:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[array([0]), array([1, 4]), array([3, 5]), array([2])]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.communication_classes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Classify the states of this Markov chain:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[array([0]), array([1, 4])]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.recurrent_classes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Obtain a list of the recurrent states:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0 1 4]\n" ] } ], "source": [ "recurrent_states = np.concatenate(mc1.recurrent_classes)\n", "print(recurrent_states)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Obtain a list of the transient states:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[2 3 5]\n" ] } ], "source": [ "transient_states = np.setdiff1d(np.arange(mc1.n), recurrent_states)\n", "print(transient_states)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A Markov chain is reducible (i.e., its directed graph is not strongly connected)\n", "if and only if by symmetric permulations of rows and columns,\n", "its transition probability matrix is written in the form (\"canonical form\")\n", "$$\n", "\\begin{pmatrix}\n", "U & 0 \\\\\n", "W & V\n", "\\end{pmatrix},\n", "$$\n", "where $U$ and $W$ are square matrices.\n", "\n", "Such a form for mc1 is obtained by the following:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 1. 0. 0. 0. ]\n", " [ 0. 0.5 0.5 0. 0. 0. ]\n", " [ 0. 0. 0.33333333 0.33333333 0.33333333 0. ]\n", " [ 0.5 0. 0. 0. 0. 0.5 ]\n", " [ 0.5 0. 0. 0. 0.5 0. ]]\n" ] } ], "source": [ "permutation = np.concatenate([recurrent_states, transient_states])\n", "print(mc1.P[permutation, :][:, permutation])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This Markov chain is aperiodic\n", "(i.e., the least common multiple of the periods of the recurrent sub-chains is one):" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.is_aperiodic" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Indeed, each of the sub-chains corresponding to the recurrent classes has period $1$,\n", "i.e., every recurrent state is aperiodic:" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Period of the sub-chain\n", "[[ 1.]]\n", " = 1\n", "Period of the sub-chain\n", "[[ 0. 1. ]\n", " [ 0.5 0.5]]\n", " = 1\n" ] } ], "source": [ "for recurrent_class in mc1.recurrent_classes:\n", " sub_matrix = P[recurrent_class, :][:, recurrent_class]\n", " d = MarkovChain(sub_matrix).period\n", " print('Period of the sub-chain\\n{0}\\n = {1}'.format(sub_matrix, d))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Stationary distributions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For each recurrent class $C$, there is a unique stationary distribution $\\psi^C$\n", "such that $\\psi^C_i > 0$ for all $i \\in C$ and $\\psi^C_i = 0$ otherwise.\n", "MarkovChain.stationary_distributions returns\n", "these unique stationary distributions for the recurrent classes.\n", "Any stationary distribution is written as a convex combination of these distributions." ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33333333 0. 0. 0.66666667 0. ]]\n" ] } ], "source": [ "print(mc1.stationary_distributions)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "These are indeed stationary distributions:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33333333 0. 0. 0.66666667 0. ]]\n" ] } ], "source": [ "print(mc1.stationary_distributions.dot(mc1.P))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot these distributions." ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def draw_histogram(distribution, ax=None, figsize=None,\n", " title=None, xlabel=None, ylabel=None, ylim=(0, 1)):\n", " \"\"\"\n", " Plot the given distribution.\n", " \n", " \"\"\"\n", " if ax is None:\n", " fig, ax = plt.subplots(figsize=figsize)\n", " n = len(distribution)\n", " ax.bar(np.arange(n), distribution, align='center')\n", " ax.set_xlim(-0.5, (n-1)+0.5)\n", " ax.set_ylim(*ylim)\n", " if title:\n", " ax.set_title(title)\n", " if xlabel:\n", " ax.set_xlabel(xlabel)\n", " if ylabel:\n", " ax.set_ylabel(ylabel)\n", " if ax is None:\n", " plt.show()" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAE7CAYAAAA7EoKDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYbFV57/Hvz3MYRGSSKLM44ACOVwM4xaPk6hGnXM0T\ng6JBjZhryIQmXJIbPWoS9HqTeBN9jFGcFTSOOIGitiIgggKKAuGoJwwyyTwp4HnvH3s3FEVVV50+\n1ae6e38/z9NPV+299tpr7dr99lur1t6VqkKSJEla7u4x7QZIkiRJm4KJryRJkjrBxFeSJEmdYOIr\nSZKkTjDxlSRJUieY+EqSJKkTOpH4JnlJkhOm3Y4NleSQJCf1PL8hyZ4TqvvIJO9pH++ZZH2SiZwP\nSfZo25pJ1NdX95OSXNDW/7xJ19/uY12SAxai7i6a9Pk1xv5mktySZGbM8g9JcmOS25O8coGbpx7G\n5oF1G5uH78PYPEGLPTbPo/4PJLk5yUVzlVsUiW+SJyc5Jcm1Sa5K8u0kj2/X3SXAjFHX3V7Iqvpo\nVT1zIdq+KVXVvatq3Vxlkqwa9aK3dR1VVa+aRLvaYPT0nrovbNu6EDeJfhPwL239x21sZe0fypv7\nFlf7o9a459UiUcAfV9Wq2QVJdkjymTbBXZfkoDsKV/1nVW0NnISv+10Ym8djbAaMzVOxDGLzYUnO\nSPLLJO8ft6Ik72v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ZlSciSStIDiPcgl\naeMkWUtzF4avjywsSZoaR3wlaSMkeSGw3qRXkhY/v7lNkuYpyQzNHOKXTrkpkqQxONVBkiRJneBU\nB0mSJHWCia8kSZI6wcRXkiRJnWDiK0mSpE4w8ZUkSVIn/H9uAktm01TWxwAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig, axes = plt.subplots(1, 2, figsize=(12, 4))\n", "titles = ['Stationary distribution for the recurrent class {0}'.format(recurrent_class)\n", " for recurrent_class in mc1.recurrent_classes]\n", "\n", "for ax, title, dist in zip(axes, titles, mc1.stationary_distributions):\n", " draw_histogram(dist, ax=ax, title=title, xlabel='States')\n", "\n", "fig.suptitle('Stationary distributions', y=-0.05, fontsize=12)\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Simulation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us simulate our Markov chain mc1.\n", "The simualte method generates a sample path\n", "of length given by the first argument, ts_length,\n", "with an initial state as specified by an optional argument init;\n", "if not specified, the initial state is randomly drawn. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A sample path from state 0:" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 0, 0, 0, 0])" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.simulate(50, init=0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As is clear from the transition matrix P,\n", "if it starts at state 0, the chain stays there forever,\n", "i.e., 0 is an absorbing state, a state that constitutes a singleton recurrent class." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Start with state 1:" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 4, 1, 4, 4, 4, 1, 4, 1, 4, 1, 4, 1, 4,\n", " 1, 4, 4, 4, 1, 4, 4, 1, 4, 1, 4, 1, 4, 4, 4, 1, 4, 4, 1, 4, 1, 4, 4,\n", " 1, 4, 1, 4])" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.simulate(50, init=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can observe that the chain stays in the recurrent class $\\{1,4\\}$\n", "and visits states 1 and 4 with certain frequencies." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If init is not specified, the initial state is randomly chosen:" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([2, 3, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", " 0, 0, 0, 0])" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.simulate(50)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Note on reproducibility**:\n", "The simulate method offers an option random_state to set a random seed\n", "to initialize the pseudo-random number generator.\n", "As you provide the same random seed value,\n", "simulate returns the same outcome." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For example, the following will always give the same sequence:" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "array([2, 4, 1, 4, 4, 4, 4, 1, 4, 1, 4, 4, 1, 4, 1, 4, 4, 4, 4, 4, 1, 4, 4,\n", " 1, 4, 1, 4, 1, 4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, 1, 4, 1, 4,\n", " 4, 4, 4, 4])" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc1.simulate(50, random_state=12345)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Time series averages" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, let us compute the frequency distribution along a sample path, given by\n", "$$\n", "\\frac{1}{t} \\sum_{\\tau=0}^{t-1} \\mathbf{1}\\{X_{\\tau} = s\\}\n", "\\quad (s \\in S).\n", "$$" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def time_series_dist(mc, t, init=None, random_state=None):\n", " \"\"\"\n", " Return the distribution of visits by a sample path of length t\n", " of mc with an initial state init.\n", " \n", " \"\"\"\n", " t_max = np.max(t)\n", " dim = 1\n", " try:\n", " ts_size = len(t) # t is an array\n", " ts_array = t\n", " dim = 2\n", " except: # t is an int\n", " ts_size = 1\n", " ts_array = [t]\n", " \n", " X = mc.simulate(ts_length=t_max, init=init, random_state=random_state)\n", " dists = np.empty((ts_size, mc.n))\n", " bins = np.arange(mc.n+1)\n", " for i, length in enumerate(ts_array):\n", " hist, bin_edges = np.histogram(X[:length], bins=bins)\n", " dists[i, :] = hist / length\n", " if dim == 1:\n", " return dists[0]\n", " else:\n", " return dists" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here is a frequency distribution along a sample path, of length 100,\n", "from initial state 1, which is a recurrent state:" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([ 0. , 0.38, 0. , 0. , 0.62, 0. ])" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "time_series_dist(mc1, t=100, init=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Length 10,000:" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([ 0. , 0.3347, 0. , 0. , 0.6653, 0. ])" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "time_series_dist(mc1, t=10**4, init=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The distribution becomes close to the stationary distribution (0, 1/3, 0, 0, 2/3, 0)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot the frequency distributions for a couple of different time lengths:" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def plot_time_series_dists(mc, init, ts, seed=None, figsize=(12,4)):\n", " dists = time_series_dist(mc, t=ts, init=init, random_state=seed)\n", "\n", " fig, axes = plt.subplots(1, len(ts), figsize=figsize)\n", " titles = ['t={0}'.format(t) for t in ts]\n", "\n", " for ax, title, dist in zip(axes, titles, dists):\n", " draw_histogram(dist, ax=ax, title=title, xlabel='States')\n", "\n", " fig.suptitle('Time series distributions with init={0}'.format(init),\n", " y=-0.05, fontsize=12)\n", " plt.show()" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAE7CAYAAAA7EoKDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu8tGVd7/HP1wdI5SAaRQkKHjDBrWIZ4jZ1qaWPpvKq\nnS+D1ChL223LrZWEHXzS2mqHrZVmUKRmbqnUCtxuUdPlARSlAEXBIH0EVPCEiIAKPr/9x9wLx8U6\nzFrrnrXWPdfn/XrNi5m5r7mu6575cj+/ueeaWakqJEmSpFl3m62egCRJkrQZLHwlSZLUBAtfSZIk\nNcHCV5IkSU2w8JUkSVITLHwlSZLUBAtfSZIkNcHCdxMk2Z3kket43J4kX0tyXXc5dRrzkxZsIKun\nJrkkybeS/OwS25+T5HNJrk1yWpJ9+pmxNDKt46zZVd+24jib5E5J/qnL+u4kx290P4bKwndzFJB1\nPva+VbV/d3lGn5OSlrDerF4A/DLw710ft0j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IWv\n1Jalvki10u2nMfoC0seBLzMq1pY7I/kY4KIk1wEvA366qr5RVVcCxwHPZ7TM4nLg1/jOAmjZs4NV\n9c+MziBehnUpAAABCUlEQVSfnuRa4KPdWAAHAKd2c9sNfBH4o2W6OoFRofZl4HeBxb/PujCH2wDP\nYXTW9EuMPt5f+F3efwU+BlyV5PNjj1vqORy/73PANYzO0L4OeGZV/Ue37WWM1ipfDbya0RuF8cfu\nAl7bLfX4qfG+q+qbwBMYrcX+AqOlC08d63ul13vi566qbgD+DfjY2Brsc4DdVfXFpR7Dtwv7LyU5\nb4nxl5vfUnNdbtvivha8GPjt7jl77gp9LOUdjN4IHMvo+bmBUQYkzYAM+OcyJUmSpIl5xleSJElN\nsPCVJElSEyx8JUmS1AQLX0mSJDXBwleSJElNsPCVJElSEyx8JUmS1AQLX0mSJDXh/wNH4pxuMPAx\nBwAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "init = 1\n", "ts = [5, 10, 50, 100]\n", "plot_time_series_dists(mc1, init, ts)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Start with state 2,\n", "which is a transient state:" ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAE7CAYAAAA7EoKDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu8bWVd7/HP1w2kcjeMAhS84AWPimWIx8itlm5N5VUn\nXwapUZZ0OpRHKwm7uNFK7XLsooewSM08YqkpeDigpssbyqW4iGwM0q2AijdEBS/g/p0/5lgyXazL\nXGuNudYa6/m8X6/5Ys45nvk8z5jruwe/Ocaz5kpVIUmSJG12d1rvCUiSJElrwcJXkiRJTbDwlSRJ\nUhMsfCVJktQEC19JkiQ1wcJXkiRJTbDwlSRJUhMsfNdAkp1JHruC1+1K8vUkX+tur57G/KRZq8jq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li0zlb4AXJjmiG2ffJE/r7j88ySO6tae38L1f5Ta+L59itLzi1CS7J/kxRmud\n59uPH0hybLfW91ZGhelsnzcAh3TjLTb3+S7zz459DKNlHrPrdS8FfibJXZLcl9GZ83E3MFpjPZ8L\nGO33C7oSnqGzAAABjUlEQVS+t3b7deYic5vdz4neu875wP2BHwUu7JZ+HAo8Anj/Aq/5HKNlM3Pn\nsBbfUHGH92z820/mub0MIMk+jNa8f7CqXrgG85S0xix8pbbM94tUiz1+FqNfQLoS+DKjYm2hM5JP\nAK5I8jXgFcDPVdW3quo64FjghYyWWXwa+E2+twBa8OxgVb2N0RnkM5PcBHy0GwtgH+DV3dx2Al9k\n9D2s8zmeUaH2ZeAPgNctsN93Ap7H6Kzplxhd3p/9Xt5/BT4GfC7J58deN997OP7cZ4EbGZ2hfT1w\n4th3w76C0VrlG4DXMPqgMP7a7cDruqUePzved1V9G3gKo7XYX2C0dOGZY30v9vOe+L2rqluAfwM+\nNrYG+3xgZ1V9cb7XcHth/6UkF88z/kLzm2+uC22b29eslwK/171ny1mj+9OM1oL/4tjZ4K92630l\nbQK5fWmfJEmStHl5xleSJElNsPCVJElSEyx8JUmS1AQLX0mSJDXBwleSJElNsPCVJElSEyx8JUmS\n1AQLX0mSJDXh/wPZf0llxApKgAAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "init = 2\n", "ts = [5, 10, 50, 100]\n", "plot_time_series_dists(mc1, init, ts)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Run the above cell several times;\n", "you will observe that the limit distribution differs across sample paths.\n", "Sometimes the state is absorbed into the recurrent class $\\{0\\}$,\n", "while other times it is absorbed into the recurrent class $\\{1,4\\}$." ] }, { "cell_type": "code", "execution_count": 29, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Some sample path with init=2\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAE7CAYA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/gdHUhceNtb3a+z3xa1dV3wT+DfjI2Bzs\n9wJ7quqLy23D9YX9l5Kct0z/K41vubGutGxpW4ueA/xe95qtZ47uTzOaC/6LY2eDv9rN95W0A+T6\nqX2SJEnSzuUZX0mSJDXBwleSJElNsPCVJElSEyx8JUmS1AQLX0mSJDXBwleSJElNsPCVJElSEyx8\nJUmS1IT/D5ilPK/S98Y1AAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Another sample path with init=2\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAE7CAYAAAA7EoKDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYbHV95/H3xwtEZREMhkRQcMEFxy0xiGPQVhO9GpUn\nmfgYiBoSE8lkSBxNIsEk41WTUbOMWXQMJkSNccREjYLjiBptd0ESFlEwEL0KLrghLriA9zt/1Gko\nml6qu09196nf+/U89dyqOqd+v9+p+nD41jm/Op2qQpIkSZp1t9jqAUiSJEmbwcJXkiRJTbDwlSRJ\nUhMsfCVJktQEC19JkiQ1wcJXkiRJTbDwlSRJUhMsfDdBkt1JHr6O1+1J8s0k3+huL5/G+KQFG8jq\ny5NcmuT7SX5xieXPSPL5JNckOT3JPv2MWBqZ1n7W7KpvW7GfTXLbJP/cZX13kuM3uh1DZeG7OQrI\nOl9776rav7s9rc9BSUtYb1YvAH4d+LeujRskeRRwCvBw4HDgzsBzNzZM6WZ638+aXU3JVuxnXwp8\nB/gh4BeAlyU5ah1jGDwL3ylL8mrgjsBZ3dGE315jE35G2hQbyWpV/e+qehejHetivwj8bVVdUlVf\nA54HnNjHmCWY6n7W7KpXW7GfTbIv8LPAH1TVtVX1AeDNwJM3tjXDZFE1ZVX1ZOAzwGO7owl/muRr\nSa5e5vasRU28tzt18YYkh2/BJqgRPWR1OUcBF449vgg4JMlBfW+D2jTF/azZVa+2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eBqRkdoXw2cNHZt2Bczmqt8FfAKRl8Uxl+7C3hVN9Xj58bb\nrqrvAY9jNBf7S4ymLjx5rO2VPu+J37uquhb4V+BjY3OwPwjsrqovL/Uabizsv5LkvCX6X258S411\nuWWL21rwAuD3u/dsLXN0f4bRXPBfGjsa/PVuvq+kGZAbp/ZJkiRJs8sjvpIkSWqCha8kSZKaYOEr\nSZKkJlj4SpIkqQkWvpIkSWqCha8kSZKaYOErSZKkJlj4SpIkqQn/HxYx1WbFtCXkAAAAAElFTkSu\nQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "init = 2\n", "ts = [5, 10, 50, 100]\n", "seeds = [222, 2222]\n", "descriptions = ['{0} sample path with init={1}'.format(adjective, init) for adjective\n", " in ['Some'] + ['Another'] + ['Yet another']*(len(seeds)-1)]\n", "\n", "for seed, description in zip(seeds, descriptions):\n", " print(description)\n", " plot_time_series_dists(mc1, init, ts, seed=seed)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In fact,\n", "for almost every sample path of a finite Markov chain $\\{X_t\\}$,\n", "for some recurrent class $C$ we have\n", "$$\n", "\\frac{1}{t} \\sum_{\\tau=0}^{t-1} \\mathbf{1}\\{X_{\\tau} = s\\} \\to \\psi^C[s]\n", "\\quad \\text{as t \\to \\infty}\n", "$$\n", "for all states $s$,\n", "where $\\psi^C$ is the stationary distribution associated with the recurrent class $C$.\n", "\n", "If the initial state $s_0$ is a recurrent state,\n", "then the recurrent class $C$ above is the one that contains $s_0$,\n", "while if it is a transient state,\n", "then the recurrent class to which the convergence occurs depends on the sample path." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us simulate with the remaining states, 3, 4, and 5." ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAD3CAYAAAD7T1f4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/A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Wvyw7uRLF6+PWRcX6SZI75DZ91j2/UL2x/b6fMhwPbAfwy5f0kz\nxsJX0lCq6hvAh4D/k2THJPdI8pAMuCdwksOTLIwG30hT3HwfeC/w7CQHJdkmyT3bL0Dt0X36MqH8\nDfCaJI9o+9k5yfPan5+Y5EntXNdbge+0fS4+lq/TTK84Ksl2SX6KZq7zUsfxo0kOaef6bqEpTBf2\neTWwZ9vfcrFnifULfT+FZprHwnzd82m+YHWvJD9OM3LedTXNHOulnE1z3K9s9z3XHteJy8S2cJxD\nnbsB+3k/8Noku6W5Y8IfAqu5/dxVLDqPVfUnnbuRLF5+MIqbxj1pPo1Ikh9Z+GJdVf0Hzfl8Xfv/\n7BeBRwEntU9/H83/xZ9qf79HAyctmhMsaR2x8JX6bakvUi33+EU0I2JfAq6nKdYGjUg+A7gwyU3A\nm4EXtN+svxw4BHgNzTSLS4GXc+diauAIYVX9C80I8olJbgS+0PYFzcfa72hjuwS4Dhj0BxYOA57U\ntv1D4N2rrXVoAAAA7UlEQVQDjvsewG/TjJp+k+YLYL/RbvsozajhVUmu6TxvqXPYXfcN4AaaUdET\ngCPbIg2ac/U9mgL3XTQXCt3nbgLe3U71+KXuvtvpBM+mmYt9Lc3UhRd29r3c73s1527xfl5PcyHx\n+XY5r123uI9BPsZdz+OwnkpTqP8rsBfN9I3TOttfQDOf+3qaL/I9t6q+CdDO1f51mgL4auBewP9c\nZf+SZkhq+fuzS5IkSeuCI76SJEnqBQtfSZIk9YKFryRJknrBwleSJEm9YOErSZKkXrDwlSRJUi9Y\n+EqSJKkXLHwlSZLUCxa+kiRJ6oX/D6qLDUDA14a4AAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "inits = [3, 4, 5]\n", "t = 100\n", "\n", "fig, axes = plt.subplots(1, 3, figsize=(12, 3))\n", "\n", "for init, ax in zip(inits, axes):\n", " draw_histogram(time_series_dist(mc1, t=t, init=init), ax=ax,\n", " title='Initial state = {0}'.format(init),\n", " xlabel='States')\n", "\n", "fig.suptitle('Time series distributions for t={0}'.format(t),\n", " y=-0.05, fontsize=12)\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Cross sectional averages" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, let us repeat the simulation for many times (say, 10,000 times)\n", "and obtain the distribution of visits to each state at a given time period T.\n", "That is, we want to simulate the marginal distribution at time T." ] }, { "cell_type": "code", "execution_count": 31, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def cross_sectional_dist(mc, T, init=None, num_reps=10**4, random_state=None):\n", " \"\"\"\n", " Return the distribution of visits at time T by num_reps times of simulation\n", " of mc with an initial state init.\n", " \n", " \"\"\"\n", " T_max = np.max(T)\n", " dim = 1\n", " try:\n", " Ts_size = len(T) # T is an array\n", " Ts_array = T\n", " dim = 2\n", " except: # T is an int\n", " Ts_size = 1\n", " Ts_array = [T]\n", " \n", " x = mc.simulate(ts_length=T_max+1, init=init, num_reps=num_reps,\n", " random_state=random_state)[:, Ts_array]\n", " dists = np.empty((x.shape[-1], mc.n))\n", " bins = np.arange(mc.n+1)\n", " for i in range(x.shape[-1]):\n", " hist, bin_edges = np.histogram(x[:, i], bins=bins)\n", " dists[i, :] = hist / num_reps\n", " if dim == 1:\n", " return dists[0]\n", " else:\n", " return dists" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Start with state 1:" ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([ 0. , 0.3333, 0. , 0. , 0.6667, 0. ])" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "init = 1\n", "T = 10\n", "cross_sectional_dist(mc1, init=init, T=T)" ] }, { "cell_type": "code", "execution_count": 33, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([ 0. , 0.3348, 0. , 0. , 0.6652, 0. ])" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T = 100\n", "cross_sectional_dist(mc1, init=init, T=T)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The distribution is close to the stationary distribution (0, 1/3, 0, 0, 2/3, 0)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot the simulated marginal distribution at T for some values of T." ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def plot_cross_sectional_dists(mc, init, Ts, num_reps=10**4, seed=None,\n", " figsize=(12,4)):\n", " dists = cross_sectional_dist(mc, T=Ts, init=init, num_reps=num_reps,\n", " random_state=seed)\n", "\n", " fig, axes = plt.subplots(1, len(Ts), figsize=figsize)\n", " titles = ['T={0}'.format(T) for T in Ts]\n", "\n", " for ax, title, dist in zip(axes, titles, dists):\n", " draw_histogram(dist, ax=ax, title=title, xlabel='States')\n", "\n", " fig.suptitle('Cross sectional distributions with init={0}'.format(init),\n", " y=-0.05, fontsize=12)\n", " plt.show()" ] }, { "cell_type": "code", "execution_count": 35, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAE7CAYAAAA7EoKDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu87HVd7/HXO7Z4R1TUAlTSMC+lUYaoqUvt5PZy5GSa\nQl5IUzpm2rFzIsqTO+3G4zxKM3uYFqknFbwr5oUyXV4gURJRFBCOohtIVEBAMAP35/wxvwXDYq01\ns/b+zVrzW9/X8/GYB3P5zff3nVnvPbzXb74zK1WFJEmStNX90GZPQJIkSdoIFl9JkiQ1weIrSZKk\nJlh8JUmS1ASLryRJkppg8ZUkSVITLL6SJElqgsV3hpJ8N8lV3WlXkmvGLh+xjnGeleT0JFck2Znk\nuCR7zXLualePuX1aknO63F6S5A1JbjvLuattPWb3qCQ/GLvvVUkePsu5qy09ZvUnkpyc5FtJdq1w\n+x2SvLvb3wXrGXurin/AYmMk+Srw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JDk\n6Unu1G1+BaMisSvJI5P8ZLcs4SpGywdu8mGdJPfK6INbN2dUyv9jbLu/YbSe+G7dtndKsvQW+puB\nn0/ylCTHa/LuAAACKklEQVTbktwxyQO62y5htN54NScAL0myX5L9uudk2q/+ug1weVX9Z5JDGS2b\nmKY8nQpcl+SF3XP+JOBnV9pwwnPyDeCg5Cbf3DBpScKdx/b9FODejNZIA3wOeFr3PD6QG689/haw\ni9V/yfggcK8kR3T3f2o39j9Omtu0GeksFd9bdL/4fBLYzmht8Bmr3GdSDlad25RWWnYyvu/rn7Nu\nqcNt1zidcP2go39nSx98HD8vaU5ZfKU5VVV/AbyY0Ye5vsnoqOrzueEDbyt9z+kRjI6QXgy8C/iD\nqvpId9tjgLOSXMXoa9KeVlXfZ7Qc4e2MyvCXGB2lW6lc3hz4U0YF698ZfVDt2O62vwROAv4pyZWM\njlgf2j2OncDjgN9mtITjDEYfOAI4Hrhvt0TiXSvs84+A04HPd6fTu+uuf5pWuM+S5wMv6+bzv7nh\nw3xr3rdbo/wkRh+kuhT4ZeCdq9x3refk7d1/L01y+pRzLuBTwMHdmC8Hfqlb40r3OO7J6MODOxj9\nUrE072uAPwZOSXJZkgdx4+8fvpTRkdrfBr7N6INrT6iqy1aZ23i+ps0IVXUeo3L8ie7ylcD/A06p\nqtU+mDcpB8vnM+m25duN37582x3AG7t9P3mV8VdzLqNlFPszWgpy9dIvf5LmU278OiRJkiRtTR7x\nlSRJUhMsvpIkSWqCxVeSJElNsPhKkiSpCRZfSZIkNcHiK0mSpCZYfCVJktQEi68kSZKa8P8BJnGL\nLvQQ7R4AAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "init = 1\n", "Ts = [2, 3, 5, 10]\n", "plot_cross_sectional_dists(mc1, init, Ts)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Starting with a transient state 2:" ] }, { "cell_type": "code", "execution_count": 36, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([ 0.5075, 0.1659, 0. , 0.0008, 0.3247, 0.0011])" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "init = 2\n", "T = 10\n", "cross_sectional_dist(mc1, init=init, T=T)" ] }, { "cell_type": "code", "execution_count": 37, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([ 0.5014, 0.1661, 0. , 0. , 0.3325, 0. ])" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T = 100\n", "dist = cross_sectional_dist(mc1, init=init, T=T)\n", "dist" ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAEZCAYAAABYR6TIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGgJJREFUeJzt3X/UXFV97/H3hySASCBAFCQEqRoUKCC1jVSKPoCViC5Q\nW4vBH02lyl3eVCvee1OsSgRbpF2taLFIbcSCSrQqNbrQqDWDQBCI8kMk4SYXI/mBAUIMAYIk5Hv/\n2HuSwzzz60nmyWRPPq+1Zj0zs/ecs895znzOnn3OmVFEYGZmZdmj3w0wM7ORc3ibmRXI4W1mViCH\nt5lZgRzeZmYFcnibmRXI4V0oSfdIevUoz+MISVskdbWdSPqipIvz/ZMlLelhW66X9M58f4akG3s4\n7bdLmt+r6Vl7kg6XtEGS2tTZIulFXU7vAkmf73XdXd1AhLekcyQtyhvE6vxGP6nf7eqVaijWRcTv\nRsSP+9WmFiLfiIgbI+JlnV4gabakazpOOOKMiOhYr4v5DdshRcSXI+L0HZ32drSlJuncFmUn5+15\ng6THc5vrjx+TdNgI5vNnkhZKekLSgiblL5f001y+SNLxDeUflPSgpPWS5kjac+RLu01EPBAR4yNf\nZNJuPXQ5vUsi4j0jrTvSzkmVpDdIuknSurxuPi9p35FOZ0cUH96Szgc+BXwCeD4wGfgscGaL+mN2\nXut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0tV9blPPRcSD+e/DwHWk\nodq+GLTw3npRkaQ9SRcVzetzm6xLkgTMAe6NiMv63Z5ekzRR0oR8/znAH5PG9YsXER+OiMkR8TvA\n24AfRcS7+t2uXpK0j6Tx+f5zgdcBfTvza6DCOyI2k672nA/cC3x1wM5UuBZYCBwpaYWkQbsg6iTg\nHcAp+VSsOyQNSs8U4AXAjyTdBdxGGvO+vs9tGi2DOIR5MHBjPmZxK/CdiPh+vxozUKcKmpntLgaq\n521mtrtweJuZFcjhbWZWIIe3mVmBHN5mZgVyeJuZFcjhbQND0t/mr1q9K58jPlXSB/IFMZ1e+9fd\n1DPbVfg8bxsIkv4Q+CfS76duknQgsDdwM/D7EbG2w+t/2U09s12Fe942KA4BHslfBUz+vuU/JX2l\n7AJJ/w0g6QpJt1d/DCH/6ENjvddJWijpp5K+li+HRtIn849F3CXpH3f6Uppl7nnbQMjhehOwD/BD\n0lcj/Ljxy/MlHRAR6/IPd/wQ+KuIuKdaT9JE0pdjTYuIjfkXmfYEPgssjIiX5WntFxGP7fSFNcM9\nbxsQEfEE6Rdc3gs8DHxV0oxcXP2K0rMl/RT4GXAMcHSTyZ2Yn18o6Q7gXcDhwHrgKUlzJL0Z2Dga\ny2LWjba/Hm9WkojYAtwA3JB/53NGvQhA0u8AHyKNba+XdBVpXLyZH0TEOY1PSpoKnEYakpmZ75vt\ndO5520CQdKSkKZWnTgCWAxuA/fJz+wFPAI9JOpj0hfp11Xq3AidJenGe9nMlTclDMxMi4rvA+cDx\no7U8Zp24522DYl/gX/L3ZW8GlpKGUM4BvidpVUSclodBlpB+Lu+myuv/raHeDOBaSXvl8r8lBfy3\nJO1NGor54M5YMLNmfMDSzKxAHjYxMyuQw9vMrEAObzOzAjm8zcwK5PA2MyuQw9vMrEAObzOzAjm8\nzcwK9P8BkTp/IuqMeloAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "draw_histogram(dist,\n", " title='Cross sectional distribution at T={T} with init={init}'\n", " .format(T=T, init=init),\n", " xlabel='States')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Observe that the distribution is close to a convex combination of\n", "the stationary distributions (1, 0, 0, 0, 0, 0) and (0, 1/3, 0, 0, 2/3, 0),\n", "which is a stationary distribution itself." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "How the simulated marginal distribution evolves:" ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAE7CAYAAAA7EoKDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu4tHVd7/H3pwcQT4iKUoBKKqZYGmWIkrrUdj4etuxM\nQ8gDeaJtpG3bRZTF46ED175KK7tMi9SdCB7wgHkgTZcpJEoiigLybEUfIEEBAcWMx+e7/5h7wbBY\na82ste5ZM/e636/rmouZuX/z+/1m1ucZvnPfv3smVYUkSZK02f3ItCcgSZIkbQQLX0mSJPWCha8k\nSZJ6wcJXkiRJvWDhK0mSpF6w8JUkSVIvWPhKkiSpFyx8JyjJd5Pc0Fx2Jblx6PZRq+jnuUnOTXJd\nkh1JTkqyZZJzV3+1mNtnJrmoye2VSd6c5M6TnLv6rcXsHpPkh0OPvSHJoyc5d/VLi1n9ySRnJvlW\nkl1LbL9bkvc04126mr43q/gDFhsjydeA51fVx9bw2F8HvgicA9wTOAN4Z1Wd1O4spVtbZ27vBfyg\nqq5KckfgDcDVVfXStucpLbbO7B4DPK+qLHY1cevM6gOAw4GrgfdW1Y8s2n5qc/X5wCHAB4BHVtWX\n1zfr7tpt2hPQaFX1t0M3r0hyCvDYac1HGkdV7Ri6GWAXcL8pTUdarUx7AtIoVfUV4CtJ7r94W7PD\n4WnAg6vqRuCsJO8Dng2csLEznR0udZiiJEcnuXaZyzVJDljmoY8BLtjIuUoLVpPbJD+f5DvA9Qze\ngF87tYmr90Zk99qh7BZw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fZrXZNyv\n/roTcG1V/VeSQxksmxineDob2JnkJc1r/jTg55ZqOOI1+SZwYHKbb24YtSThnkNjPwN4IIM9igCf\nB57ZvI4P49Zrj78F7GL5DxkfAh6Q5Kjm8Uc2ff/TqLmNm5HGQuG7Z/PB51PAVgZrg89b5jGjcrDs\n3Ma01LKT4bFvfs2apQ53XuFyKkCS/YGPAa9r1ilL6gALX2lGVdVfAC9jcDLXVQz2qr6YW054W+p7\nTo9isIf0CuDdwB9V1ceabU8ALkhyA4OvSXtmVf2AwXKEdzIohr/MYC/dUsXl7YA/ZVBg/QeDE9VO\naLb9JXAG8M9Jrmewx/rQ5nnsAJ4E/DaDJRznMTjhCOBk4OBmicS7lxjz1cC5wBeay7nNfTe/TEs8\nZsGLgVc28/lDbjmZb8XHNmuUn8bgRKqrgV8BTl/msSu9Ju9s/nt1knPHnHMBnwYOavp8FfDLzRpX\nmudxPwYnD25j8KFiYd43An8MnJXkmiQP59bfP3w1gz21vw18m8GJa0+pqmuWmdtwvsbNCFV1CYPi\n+JPN7euB/wecVVXLnZg3KgeL5zNq2+J2w9sXt90GvKUZ++nL9L+UFzA46W7b0N7g61fxeElTkFu/\nD0mSJEmbk3t8JUmS1AsWvpIkSeoFC19JkiT1goWvJEmSesHCV5IkSb1g4StJkqResPCVJElSL1j4\nSpIkqRf+P3s4aAGjgxZxAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "init = 2\n", "Ts = [2, 3, 5, 10]\n", "plot_cross_sectional_dists(mc1, init, Ts)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since our Markov chain is aperiodic (i.e., every recurrent class is aperiodic),\n", "the marginal disribution at time $T$ converges as $T \\to \\infty$\n", "to some stationary distribution,\n", "and the limit distribution depends on the initial state,\n", "according to the probabilities that the state is absorbed into the recurrent classes." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For initial states 3, 4, and 5:" ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAD3CAYAAAD7T1f4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu4bXVd7/H3xw2KxlVRlItShte8pW0xMpfi0Q2aWFYK\noVGWnMysoxWZljs1zdPFG6VkpHlJzFuCoeSF5QUUREFFNzxwjLgpyG3LzQT29/wxxpK5F3OuNdfe\nc83LGu/X84xnzTnHb47fd4y1vnN+x2/+5lipKiRJkqS17k6TDkCSJEkaBwtfSZIkdYKFryRJkjrB\nwleSJEmdYOErSZKkTrDwlSRJUidY+I5JkpOTPHeJ9W9N8oohtzWf5Pmji05SL/NVmi3mrIZl4bsd\nklyU5OBh2lbVoVX17vZ5RyX5/KL1v1NVrxmy62qXlcS6f5ItSYb+nbf796SV9DMKSU5NcmWSzUnO\nSfKMccegtcd8XV1JntDG/OpJxaC1xZxdHW2/NyW5vl0+Me4YJmmHSQcw41acHFMgK2hbK2w/Ki8G\nzquqW5KsBz6V5ICqumICsWjtMF9XSZIdgTcBX2L2jrGmlzm7Ogp4elV9ZgJ9T5wjviPSnmF+Iclf\nJ7kmybeTbOhZP5/k+UkeBLwNeFx7pnVNu/6dCyMlSfZI8rF21POaJCcl2WfIONYnOasdLf1ukr9p\nV32u/Xld2+9jk9w/yWeSXJXke0nek2S3djvvBu4LnNS2/8P28QOTnJ7k2nY09gmjOH69quobVXVL\nz0M7AvuNuh91l/k6ci8FPgGcz4SKb61t5uzIdTZPLXxHaz1wHnAP4P8Cx/esK6Cq6jzgaOCLVbVL\nVd29d317O+1z79suNwPHDhnDm4A3VNVuwE8AH2gff3z7c7e23zPa+38J3Ad4ME1xuZEm0OcCF9Oc\nFe5SVX/TvjB8DHhVVe0B/CHwoSR79gukfWG5dsBy4lI70T73ZpoRpFOr6qwh918alvnaY1vzNcn9\ngN8AXk2H30w1FuZsj+15jwXe2xb+pyR5+JD7vi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yX0pxErW+nkjyBrUe4t6voTfK23H6l\nh8XLN/o8pV9/3wQevuixh7ePS1ojLHylNaCqNgN/TjNn9bB2hG3HJIckWSissug5lwCnA69rvxT2\ncOA3gfcAJDkyyT3b5ptpioUtSZ6Y5GHttITraaYP3LY4piQPaL+4dReaovwHPe3eRjOf+L5t23sm\nWfgI/b3Ak5P8SpIdktwjt19W6gqa+caDvA94RZI9k+zZHpNhL/21M3BtVf0wyXqaaRPDFGSnA7cm\neXF7zH8J+Jl+DZc5Jt8F9l80CgrLTwG4V0/fvwI8iGaONMA5wHPa4/gYtp57/D1gC4NPMj4OPCDJ\n4e3zn91u+2MriG3BzjQjwpvbucOLvzh4xRJxLKuq/vfClR/6LA/7UbDJnZLsBOwI3Kn9u1+4asM8\ncFt7LO+S5MU0x+cz2xqXpOlj4SutEVX1d8BLaL7MdSXNqOoLuf0Lb4tHfKH5ctL+NCOEHwb+vKoW\n3uifCpyb5Hqay6Q9p6r+h2Y6wgdoiuFv0RQM/YrLuwCvoymwvkPzRbWXteveBJwI/GeS79OMWK9v\n9+MS4FBMmqTmAAABFUlEQVSaUcKrgbO5fSTueOAh7RSJD/fp8zXAWTRfUvp6e/s1vYepz3MWvBB4\nVRvPn3H7l/mWfG47R/mXaL7kdTXwq8CHBjx3qWPygfbn1UnOGjLmAr4EHNBu89XAs6rq2nb9n9EU\nlNfSTK94b0/cNwF/CZzWXmnhsWx9/eGraUbzXwpcRfPFtadX1TUDYuv397XgjcBd2+2cTlNU97Z9\nE80c72uSvHGJ/V3c50o9j2Z6yz/QfLnvZuA4+NHv8Zltm2vbn88cMK9a0oxK1aSnVUmSJEmrzxFf\nSZIkdYKFryRJkjrBwleSJEmdYOErSZKkTrDwlSRJUidY+EqSJKkTLHwlSZLUCRa+kiRJ6gQLX0mS\nJHXC/wekWH4iVysTFwAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "inits = [3, 4, 5]\n", "T = 10\n", "\n", "fig, axes = plt.subplots(1, 3, figsize=(12, 3))\n", "\n", "for init, ax in zip(inits, axes):\n", " draw_histogram(cross_sectional_dist(mc1, T=T, init=init), ax=ax,\n", " title='Initial state = {0}'.format(init),\n", " xlabel='States')\n", "\n", "fig.suptitle('Cross sectional distribution at T={0}'.format(T),\n", " y=-0.05, fontsize=12)\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Powers of $P$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "The marginal distributions at time $T$ are obtained by $P^T$." ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "collapsed": true }, "outputs": [], "source": [ "np.set_printoptions(suppress=True) # Suppress printing with floating point notation" ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "P^10 =\n", "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33398438 0. 0. 0.66601562 0. ]\n", " [ 0.49807228 0.16679179 0.00001694 0.0007677 0.33319974 0.00115155]\n", " [ 0.99902344 0. 0. 0.00097656 0. 0. ]\n", " [ 0. 0.33300781 0. 0. 0.66699219 0. ]\n", " [ 0.99902344 0. 0. 0. 0. 0.00097656]]\n", "P^20 =\n", "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33333397 0. 0. 0.66666603 0. ]\n", " [ 0.49999809 0.16666679 0. 0.00000076 0.33333321 0.00000114]\n", " [ 0.99999905 0. 0. 0.00000095 0. 0. ]\n", " [ 0. 0.33333302 0. 0. 0.66666698 0. ]\n", " [ 0.99999905 0. 0. 0. 0. 0.00000095]]\n", "P^30 =\n", "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33333333 0. 0. 0.66666667 0. ]\n", " [ 0.5 0.16666667 0. 0. 0.33333333 0. ]\n", " [ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33333333 0. 0. 0.66666667 0. ]\n", " [ 1. 0. 0. 0. 0. 0. ]]\n" ] } ], "source": [ "Ts = [10, 20, 30]\n", "for T in Ts:\n", " print('P^{T} =\\n{P_T}'.format(T=T, P_T=np.linalg.matrix_power(mc1.P, T)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the canonical form:" ] }, { "cell_type": "code", "execution_count": 43, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Q =\n", "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 1. 0. 0. 0. ]\n", " [ 0. 0.5 0.5 0. 0. 0. ]\n", " [ 0. 0. 0.33333333 0.33333333 0.33333333 0. ]\n", " [ 0.5 0. 0. 0. 0. 0.5 ]\n", " [ 0.5 0. 0. 0. 0.5 0. ]]\n", "Q^10 =\n", "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33398438 0.66601562 0. 0. 0. ]\n", " [ 0. 0.33300781 0.66699219 0. 0. 0. ]\n", " [ 0.49807228 0.16679179 0.33319974 0.00001694 0.0007677 0.00115155]\n", " [ 0.99902344 0. 0. 0. 0.00097656 0. ]\n", " [ 0.99902344 0. 0. 0. 0. 0.00097656]]\n", "Q^20 =\n", "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33333397 0.66666603 0. 0. 0. ]\n", " [ 0. 0.33333302 0.66666698 0. 0. 0. ]\n", " [ 0.49999809 0.16666679 0.33333321 0. 0.00000076 0.00000114]\n", " [ 0.99999905 0. 0. 0. 0.00000095 0. ]\n", " [ 0.99999905 0. 0. 0. 0. 0.00000095]]\n", "Q^30 =\n", "[[ 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0.33333333 0.66666667 0. 0. 0. ]\n", " [ 0. 0.33333333 0.66666667 0. 0. 0. ]\n", " [ 0.5 0.16666667 0.33333333 0. 0. 0. ]\n", " [ 1. 0. 0. 0. 0. 0. ]\n", " [ 1. 0. 0. 0. 0. 0. ]]\n" ] } ], "source": [ "Q = mc1.P[permutation, :][:, permutation]\n", "print('Q =\\n{Q}'.format(Q=Q))\n", "for T in Ts:\n", " print('Q^{T} =\\n{Q_T}'.format(T=T, Q_T=np.linalg.matrix_power(Q, T)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Observe that the first three rows, which correspond to the recurrent states,\n", "are close to the stationary distributions associated with the corresponding recurrent classes." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2: Periodic chain" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Consider the Markov chain given by the following stochastic matrix,\n", "taken from Exercise 9 (see also Exercise 11) in Jarvis and Shier\n", "(where the actual values of non-zero probabilities are not important):" ] }, { "cell_type": "code", "execution_count": 44, "metadata": { "collapsed": true }, "outputs": [], "source": [ "P = np.zeros((10, 10))\n", "P[0, 3] = 1\n", "P[1, [0, 4]] = 1/2\n", "P[2, 6] = 1\n", "P[3, [1, 2, 7]] = 1/3\n", "P[4, 3] = 1\n", "P[5, 4] = 1\n", "P[6, 3] = 1\n", "P[7, [6, 8]] = 1/2\n", "P[8, 9] = 1\n", "P[9, 5] = 1" ] }, { "cell_type": "code", "execution_count": 45, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[ 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. ]\n", " [ 0.5 0. 0. 0. 0.5 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. ]\n", " [ 0. 0.333 0.333 0. 0. 0. 0. 0.333 0. 0. ]\n", " [ 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.5 0. 0.5 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. ]\n", " [ 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. ]]\n" ] } ], "source": [ "np.set_printoptions(precision=3) # Reduce the number of digits printed\n", "print(P)" ] }, { "cell_type": "code", "execution_count": 46, "metadata": { "collapsed": false }, "outputs": [], "source": [ "mc2 = MarkovChain(P)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This Markov chain is irreducible:" ] }, { "cell_type": "code", "execution_count": 47, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc2.is_irreducible" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This Markov chain is periodic:" ] }, { "cell_type": "code", "execution_count": 48, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc2.is_aperiodic" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Its period, which we denote by $d$:" ] }, { "cell_type": "code", "execution_count": 49, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3\n" ] } ], "source": [ "d = mc2.period\n", "print(d)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Identify the cyclic classes:" ] }, { "cell_type": "code", "execution_count": 50, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[array([0, 4, 6, 8]), array([3, 9]), array([1, 2, 5, 7])]" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mc2.cyclic_classes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Cyclic normal form" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If a Markov chain is periodic with period $d \\geq 2$,\n", "then its transition probability matrix is written in the form (\"cyclic normal form\")\n", "$$\n", "\\begin{pmatrix}\n", "0 & P_0 & 0 & 0 & \\cdots & 0 \\\\\n", "0 & 0 & P_1 & 0 & \\cdots & 0 \\\\\n", "0 & 0 & 0 & P_2 & \\cdots & 0 \\\\\n", "\\vdots & \\vdots & \\vdots & \\vdots & \\ddots & \\vdots \\\\\n", "0 & 0 & 0 & 0 & \\cdots & P_{d-2} \\\\\n", "P_{d-1} & 0 & 0 & 0 & \\cdots & 0\n", "\\end{pmatrix}.\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Represent our Markov chain in cyclic normal form:" ] }, { "cell_type": "code", "execution_count": 51, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. ]\n", " [ 0.5 0.5 0. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0.5 0.5 0. 0. 0. 0. 0. 0. ]]\n" ] } ], "source": [ "permutation = np.concatenate(mc2.cyclic_classes)\n", "Q = mc2.P[permutation, :][:, permutation]\n", "print(Q)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Re-define the Markov chain with the above matrix Q:" ] }, { "cell_type": "code", "execution_count": 52, "metadata": { "collapsed": true }, "outputs": [], "source": [ "mc2 = MarkovChain(Q)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Obtain the block components $P_0, \\cdots, P_{d-1}$:" ] }, { "cell_type": "code", "execution_count": 53, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "P_0 =\n", "[[ 1. 0.]\n", " [ 1. 0.]\n", " [ 1. 0.]\n", " [ 0. 1.]]\n", "P_1 =\n", "[[ 0.333 0.333 0. 0.333]\n", " [ 0. 0. 1. 0. ]]\n", "P_2 =\n", "[[ 0.5 0.5 0. 0. ]\n", " [ 0. 0. 1. 0. ]\n", " [ 0. 1. 0. 0. ]\n", " [ 0. 0. 0.5 0.5]]\n" ] } ], "source": [ "P_blocks = []\n", "\n", "for i in range(d):\n", " P_blocks.append(mc2.P[mc2.cyclic_classes[i%d], :][:, mc2.cyclic_classes[(i+1)%d]])\n", " print('P_{i} =\\n{P_block}'.format(i=i, P_block=P_blocks[i]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$P^d$ is block diagonal:" ] }, { "cell_type": "code", "execution_count": 54, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[ 0.167 0.167 0.5 0.167 0. 0. 0. 0. 0. 0. ]\n", " [ 0.167 0.167 0.5 0.167 0. 0. 0. 0. 0. 0. ]\n", " [ 0.167 0.167 0.5 0.167 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.833 0.167 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0.167 0.167 0.5 0.167]]\n" ] } ], "source": [ "P_power_d = np.linalg.matrix_power(mc2.P, d)\n", "print(P_power_d)" ] }, { "cell_type": "code", "execution_count": 55, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0th diagonal block of P^d =\n", "[[ 0.167 0.167 0.5 0.167]\n", " [ 0.167 0.167 0.5 0.167]\n", " [ 0.167 0.167 0.5 0.167]\n", " [ 0. 1. 0. 0. ]]\n", "1st diagonal block of P^d =\n", "[[ 0.833 0.167]\n", " [ 1. 0. ]]\n", "2nd diagonal block of P^d =\n", "[[ 0.333 0.333 0. 0.333]\n", " [ 0.333 0.333 0. 0.333]\n", " [ 0.333 0.333 0. 0.333]\n", " [ 0.167 0.167 0.5 0.167]]\n" ] } ], "source": [ "P_power_d_blocks = []\n", "ordinals = ['0th', '1st', '2nd']\n", "\n", "for i in range(d):\n", " P_power_d_blocks.append(P_power_d[mc2.cyclic_classes[i], :][:, mc2.cyclic_classes[i]])\n", " print('{ordinal} diagonal block of P^d =\\n{P_power_d_block}'\n", " .format(ordinal=ordinals[i], P_power_d_block=P_power_d_blocks[i]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The $i$th diagonal block of $P^d$ equals $P_i P_{i+1} \\cdots P_{d-1} P_0 \\cdots P_{i-1}$:" ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "P_0 P_1 P_2 =\n", "[[ 0.167 0.167 0.5 0.167]\n", " [ 0.167 0.167 0.5 0.167]\n", " [ 0.167 0.167 0.5 0.167]\n", " [ 0. 1. 0. 0. ]]\n", "P_1 P_2 P_0 =\n", "[[ 0.833 0.167]\n", " [ 1. 0. ]]\n", "P_2 P_0 P_1 =\n", "[[ 0.333 0.333 0. 0.333]\n", " [ 0.333 0.333 0. 0.333]\n", " [ 0.333 0.333 0. 0.333]\n", " [ 0.167 0.167 0.5 0.167]]\n" ] } ], "source": [ "products = []\n", "\n", "for i in range(d):\n", " R = np.eye(P_blocks[i].shape[0])\n", " string = ''\n", " for j in range(d):\n", " R = R.dot(P_blocks[(i+j)%d])\n", " string += 'P_{0} '.format((i+j)%d)\n", " products.append(R)\n", " print(string + '=\\n{R}'.format(R=R))" ] }, { "cell_type": "code", "execution_count": 57, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "True\n", "True\n", "True\n" ] } ], "source": [ "for matrix0, matrix1 in zip(P_power_d_blocks, products):\n", " print(np.array_equal(matrix0, matrix1))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Stationary distributions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The Markov chain mc2 has a unique stationary distribution,\n", "which we denote by $\\pi$:" ] }, { "cell_type": "code", "execution_count": 58, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(mc2.stationary_distributions)" ] }, { "cell_type": "code", "execution_count": 59, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ 0.048 0.095 0.143 0.048 0.286 0.048 0.095 0.095 0.048 0.095]\n" ] } ], "source": [ "pi = mc2.stationary_distributions[0]\n", "print(pi)" ] }, { "cell_type": "code", "execution_count": 60, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEZCAYAAACD/A7qAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGTxJREFUeJzt3X+8XHV95/HXu4lRIfy0WCSAsRpWpOIi3RhF17Fm2Vu0\nhq19bBZBFnWV3W0s/ug+WLa7crXdWtplt9vSpVFTi4pGyiJNKxqhOojAQlKRXyY8SCU1CYKUSPgh\n1MS8949zbjJMZu5Mcn/M3O99Px+PPDLnfL/fM59zbvKeM985Z65sExER5fiZQRcQERGTK8EeEVGY\nBHtERGES7BERhUmwR0QUJsEeEVGYBHsMhKSzJa0ddB37S9J5km5qWX5C0sJJ2vZFkj5ZP14oabek\nSfk/Kun4ulZNxvZiuCXYoyNJr5d0i6THJD0q6VuSfrFue1a49bGtfULK9pW2/+VU1D6dbB9ie/N4\nfSQ1JG3pY1sft/3eyahL0mZJv9Sy7e/XtebGlVlg7qALiOEj6VDgr4HzgauA5wJvAP5xopue4PgJ\nk/QztncPuo52kubY/ukkbtIMwfGOwcgZe3RyAmDbX3TlGdvX275b0onA5cBr67f22wEkvUXSHZJ2\nSPq+pItbtvfN+u/HJD0uaU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Jk/FREREBwn2iIjCJNgjIgqTYI+IKEyCPSKiMAn2iIjCJNij\neJJ+q/661jvrr/JdLOkCSc/vY+wH+ukXMUxyHXsUTdJrqb786Y22d0o6EngecDPwi7Yf7TH+gX76\nRQyTnLFH6Y4G/qH+amdsbwd+jeqLoL4h6W8AJF0uaV19Zj9ar/uNDv1Ol3SLpL+VdJWkg+v1v1f/\nkpM7Jf3BtO9lRIucsUfR6uD9FtX3b98AfNH2N+sz8VProEfSEbZ/VP8ClxuA99u+p7WfpJ+l+pK1\nEdtP17+1ax7wJ8Attl9eb+tQ249P+85G1HLGHkWz/RRwKvA+4BHgi5LOq5tbv9Z3uaS/pfoOkZOo\nfitXuyX1+lvq7+M5Fzge2AE8I2mVpH8FPD0V+xLRrxn7JWAR/bK9G7gRuFHS3cB5Y00Akl4CfJhq\nLn2HpE9TzcN3cr3td7SvlLQYeDPVNM+K+nHEQOSMPYom6QRJi1pWnQJsBp4ADq3XHUr1Sygel/Rz\nwC+39G/tdxtwmqSX1ts+WNKierrncNtfAT4EvGqq9ieiHzljj9LNB/5Y0uFUX9d6P9W0zDuAr0ra\nZvvN9dTKRqpft/itlvGfaOt3HvCFlt9w/1tU4f+Xkp5HNb3zwenYsYhu8uFpRERhMhUTEVGYBHtE\nRGES7BERhUmwR0QUJsEeEVGYBHtERGES7BERhUmwR0QU5v8D00cQAgxTCmEAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "draw_histogram(pi,\n", " title='Stationary distribution', xlabel='States', ylim=(0, 0.35))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Obtain the stationary distributions $\\pi^0, \\ldots, \\pi^{d-1}$\n", "each associated with the diagonal blocks of $P^d$:" ] }, { "cell_type": "code", "execution_count": 61, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "pi^0 =\n", "[ 0.143 0.286 0.429 0.143]\n", "pi^1 =\n", "[ 0.857 0.143]\n", "pi^2 =\n", "[ 0.286 0.286 0.143 0.286]\n" ] } ], "source": [ "pi_s = []\n", "\n", "for i in range(d):\n", " pi_s.append(MarkovChain(P_power_d_blocks[i]).stationary_distributions[0])\n", " print('pi^{i} =\\n{pi_i}'.format(i=i, pi_i=pi_s[i]))" ] }, { "cell_type": "code", "execution_count": 62, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAD6CAYAAABH0UQmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X20bXVd7/H3x3MQRJ7lhh04hiaYYJpZhFnXnTD0RIpd\nbaT4FNZNxrhh5sONLJOjVmRd0wojNXw2sNQM71C4mWyfIPABQRAIFPRwUOQZIsxz5Hv/mHPDOou9\n9t5n77XXw57v1xhrnDXX/K05v3PO9d3nu37zN+dKVSFJkiStdQ8YdwCSJEnSKFj4SpIkqRMsfCVJ\nktQJFr6SJEnqBAtfSZIkdYKFryRJkjrBwleSJEmdsH7cAWj0kuwH/CbwXeCSqvrSmEOStIAkewNH\nAY+qqlPGHY+kwZIcAjwGeCzwsar68phDUg97fLvp14BzgfcBrxhzLJIWUVW3A18CHjjuWCQt6unA\nVuAvgFeNORb1sfDtpkcA366q7cB+4w5GkqS1oqreXFUXAhuBa8Ydj3Zk4dtNDwB+0D73N6slSRq+\nXwb+eNxBaEcWvt10JXBAkt2AO8YdjKQlybgDkLQ0SY4F/ho4cNyxaEcWvt30AeBo4EXAX445FkmL\nSLIn8GzgCUkeM+54JA2W5FnAHwIfAX51zOGoT6o8071WtVeC/wVwKLAN2IdmwP3nquqN44xN0v2Z\ns9L0WCBfP1tVfzbO2DSYhe8aluRoYJbmLg7vAX6rquzhlSaUOStND/N1Onkf3zWsqj4JkOQRVbU9\nyUHjjknSYOasND3M1+nkGN81LslRNKdeAH5inLFIWpw5K00P83X6WPiufb8G/HP7fI8kXhkuTTZz\nVpoe5uuUcYyvJEmS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nJnkoTS9srxsYsL+ragvNGNNT2gutHksz/vb987Xv285DkzylvZjpv2iKoEF3o+jfnjOAl6e5kG0P\nmmN1Zi39rg9L3Y9zLgTuTPK77T5cl+QxaW/L12tnjnVrvs/7nA/TnFF4YnvR2ua+OM+gOa77J9mf\nZijEUu9FvFCeLSbAbyU5sB3i8wc0QyX6XUDTy/y77ed6hqZQPbMdTvJO4C/SXKS5rmc751xGM+b6\nrXMXxaW5aO/H2yEld9IM5xjmXUykzrLwlVbuTuBngAvS3AnhfJqLYubuKvCvNP+5fSfJd9vX/hfw\n+iR30FzNf+8PFlTVf9KMJ/x8ezX5z9DT41lVN9P8x/pKmh6lVwFPr6pbemKqvudz0++lOQ27Fbi0\njXVQ217/RNPj9U/t+NpBTqQpNr5D8x/+O+dZ/pwXANe0Qy5eQjOmlaq6gqbY+Ua7/XN3I5ivx7d/\n2Z+mudDok8CfV9Xc3Q7eB1xMc8HS2TQFTO97T6Eprm5N8op5Yj2OptfxepqC77VV9akBcfS+d9d2\n2TfSXMy3P83wgfn0L+edbdyfAb5BU1y9tK/9QDu5H+eK2afTjAf/Rhvz24G9mN/OHOuFPu+Xtdt1\nJs3+vZPm4sG5cct/BHyRJqcuaZ//0YD19Bu43iW8t2iG+fw/mqEKV8233na87jNoLqy7keYiyBdW\n1b+37V4FfBX4As0QjlO4r7CfW8YlNPv+HUmeRnNG4h+B24Gv0Vywuio/PCJ1TZovpJK0sCRXAy/p\nKfikoWt7t28FHllV31ysvSTtDHt8JS0qybOBeyx6tRqSPCPJ7u3wm/8DXGLRK2k1eJWopAUlmaUZ\nQ/zCRZpuiUzLAAAASElEQVRKy3UszTCc0AwJuN8t1CRpGBzqIEmSpE5wqIMkSZI6wcJXkiRJnWDh\nK0mSpE6w8JUkSVInWPhKkiSpEyx8JUmS1An/HwA0L6gxTXfwAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig, axes = plt.subplots(1, d, figsize=(12, 3))\n", "\n", "for i, ax in enumerate(axes):\n", " pi_i_full_dim = np.zeros(mc2.n)\n", " pi_i_full_dim[mc2.cyclic_classes[i]] = pi_s[i]\n", " draw_histogram(pi_i_full_dim,\n", " ax=ax, title='$\\pi^{i}$'.format(i=i), xlabel='States')\n", "\n", "fig.suptitle('Stationary distributions for the diagonal blocks',\n", " y=-0.05, fontsize=12)\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Verify that $\\pi^{i+1} = \\pi^i P_i$:" ] }, { "cell_type": "code", "execution_count": 63, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "pi^0 P_0 =\n", "[ 0.857 0.143]\n", "pi^1 P_1 =\n", "[ 0.286 0.286 0.143 0.286]\n", "pi^2 P_2 =\n", "[ 0.143 0.286 0.429 0.143]\n" ] } ], "source": [ "for i in range(d):\n", " print('pi^{i} P_{i} =\\n{dot}'.format(i=i, dot=np.dot(pi_s[i], P_blocks[i])))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Verify that $\\pi = (\\pi^0 + \\cdots + \\pi^{d-1})/d$:" ] }, { "cell_type": "code", "execution_count": 64, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ 0.048 0.095 0.143 0.048 0.286 0.048 0.095 0.095 0.048 0.095]\n" ] } ], "source": [ "# Right hand side of the above identity\n", "rhs = np.zeros(mc2.n)\n", "\n", "for i in range(d):\n", " rhs[mc2.cyclic_classes[i]] = pi_s[i]\n", "rhs /= d\n", "print(rhs)" ] }, { "cell_type": "code", "execution_count": 65, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 65, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.allclose(pi, rhs)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Powers of $P$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since the Markov chain in consideration is periodic,\n", "the marginal distribution does not converge, but changes periodically." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us compute the powers of the transition probability matrix (in cyclic normal form):" ] }, { "cell_type": "code", "execution_count": 66, "metadata": { "collapsed": true }, "outputs": [], "source": [ "np.set_printoptions(suppress=True) # Suppress printing with floating point notation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Print $P^1, P^2, \\ldots, P^d$:" ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "P^1 =\n", "[[ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. ]\n", " [ 0.5 0.5 0. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0.5 0.5 0. 0. 0. 0. 0. 0. ]]\n", "P^2 =\n", "[[ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. ]\n", " [ 0.167 0.167 0.5 0.167 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.5 0.5 0. 0. 0. 0. ]]\n", "P^3 =\n", "[[ 0.167 0.167 0.5 0.167 0. 0. 0. 0. 0. 0. ]\n", " [ 0.167 0.167 0.5 0.167 0. 0. 0. 0. 0. 0. ]\n", " [ 0.167 0.167 0.5 0.167 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.833 0.167 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0.333 0.333 0. 0.333]\n", " [ 0. 0. 0. 0. 0. 0. 0.167 0.167 0.5 0.167]]\n" ] } ], "source": [ "for i in range(1, d+1):\n", " print('P^{i} =\\n{P_i}'.format(i=i, P_i=np.linalg.matrix_power(mc2.P, i)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Print $P^{2d}$, $P^{4d}$, and $P^{6d}$:" ] }, { "cell_type": "code", "execution_count": 68, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "P^6 =\n", "[[ 0.139 0.306 0.417 0.139 0. 0. 0. 0. 0. 0. ]\n", " [ 0.139 0.306 0.417 0.139 0. 0. 0. 0. 0. 0. ]\n", " [ 0.139 0.306 0.417 0.139 0. 0. 0. 0. 0. 0. ]\n", " [ 0.167 0.167 0.5 0.167 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.861 0.139 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.833 0.167 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.278 0.278 0.167 0.278]\n", " [ 0. 0. 0. 0. 0. 0. 0.278 0.278 0.167 0.278]\n", " [ 0. 0. 0. 0. 0. 0. 0.278 0.278 0.167 0.278]\n", " [ 0. 0. 0. 0. 0. 0. 0.306 0.306 0.083 0.306]]\n", "P^12 =\n", "[[ 0.143 0.286 0.428 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.428 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.428 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.144 0.282 0.431 0.144 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.856 0.144 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.285 0.285 0.144 0.285]\n", " [ 0. 0. 0. 0. 0. 0. 0.285 0.285 0.144 0.285]\n", " [ 0. 0. 0. 0. 0. 0. 0.285 0.285 0.144 0.285]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.141 0.286]]\n", "P^18 =\n", "[[ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]]\n" ] } ], "source": [ "for i in [k*d for k in [2, 4, 6]]:\n", " print('P^{i} =\\n{P_i}'.format(i=i, P_i=np.linalg.matrix_power(mc2.P, i)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$P^{kd}$ converges as $k \\to \\infty$ to a matrix that contains $\\pi^0, \\ldots, \\pi^{d-1}$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Print $P^{kd+1}, \\ldots, P^{kd+d}$ with $k = 10$ for example:" ] }, { "cell_type": "code", "execution_count": 69, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "P^31 =\n", "[[ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]]\n", "P^32 =\n", "[[ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]]\n", "P^33 =\n", "[[ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0.143 0.286 0.429 0.143 0. 0. 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0.857 0.143 0. 0. 0. 0. ]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]\n", " [ 0. 0. 0. 0. 0. 0. 0.286 0.286 0.143 0.286]]\n" ] } ], "source": [ "for i in range(10*d+1, 10*d+1+d):\n", " print('P^{i} =\\n{P_i}'.format(i=i, P_i=np.linalg.matrix_power(mc2.P, i)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "But $P^i$ itself does not converge." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Simulation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot the frequency distribution of visits to the states\n", "along a sample path starting at state 0:" ] }, { "cell_type": "code", "execution_count": 70, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ 0.047 0.092 0.148 0.046 0.287 0.046 0.093 0.098 0.046 0.096]\n" ] } ], "source": [ "init = 0\n", "dist = time_series_dist(mc2, init=init, t=10**4)\n", "print(dist)" ] }, { "cell_type": "code", "execution_count": 71, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEZCAYAAACD/A7qAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGxpJREFUeJzt3X20XXV95/H3xwRGCQ+iUhmejA+hokss6sQ4iB6VYu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RLgX4Ad9f8fG+6oZk4+oBQRUZi5XIqJiIgOEuwREYVJ\nsEdEFCbBHhFRmAR7RERhEuwREYVJsEfxJP1J/XWtN9Vf5btU0tskPW6Avn8wSLuIUZLr2KNokl5E\n9eVPL7W9XdITgMcC1wEvsH1fn/4/GKRdxCjJjD1Kdyjwo/qrnbF9P/CbVF8E9TVJ/wAg6UJJa+uZ\n/Vi97Pc7tDtJ0jck/bOkL0haVC9/f/1HTm6S9BezfpQRDZmxR9Hq4P061fdvXwV83vY19Uz8+XXQ\nI+lg2w/Uf8DlKuCttr/TbCfpSVRfsrbc9iP1X+3aF/gI8A3bz6y3daDtB2f9YCNqmbFH0Ww/DDwf\neAtwL/B5SafXq5tf63uypH+m+g6RZ1P9Va6JltXLv1F/H8+bgKOAbcDPJK2S9OvAIzNxLBGDmrNf\nAhYxKNs7gauBqyV9Gzh9fBWApKcC76CqpW+T9HGqOnwnX7V96sSFkpYCr6Aq86ysb0cMRWbsUTRJ\nR0ta0lh0HLAJ+AlwYL3sQKo/QvGgpCcDv9Zo32x3A3C8pKfX214kaUld7nm87S8DbweeO1PHEzGI\nzNijdPsDfy3p8VRf13orVVnmVOArku6y/Yq6tLKB6s8tfr3R/2MT2p0OfK7xF+7/hCr8/4+kx1KV\nd86ejQOL6CZvnkZEFCalmIiIwiTYIyIKk2CPiChMgj0iojAJ9oiIwiTYIyIKk2CPiChMgj0iojD/\nH6OFzIj5tgGOAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "draw_histogram(dist,\n", " title='Time series distribution with init={0}'.format(init),\n", " xlabel='States', ylim=(0, 0.35))\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Observe that the distribution is close to the (unique) stationary distribution $\\pi$." ] }, { "cell_type": "code", "execution_count": 72, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ 0.048 0.095 0.143 0.048 0.286 0.048 0.095 0.095 0.048 0.095]\n" ] } ], "source": [ "print(pi)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, plot the simulated marginal distributions\n", "at $T = 10d+1, \\ldots, 11d, 11d+1, \\ldots, 12d$ with initial state 0:" ] }, { "cell_type": "code", "execution_count": 73, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAGZCAYAAABvxjJmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X20ZHdd5/v353YnQCRPEM2dPEAAAxIkCmrIgMBBsi5t\nYJERRWhABJkx62KQq3PHEHRMK46YWUt5mCAGiMjw1EpADMokyshxEBHIJRAhnUwChHQnPJgASXhQ\n0vT3/rF3J9WVU6eqz6lTtevs92utvbqq9q69v7X7fM751t6/2pWqQpIkSdrs/o95FyBJkiTNgo2v\nJEmSesHGV5IkSb1g4ytJkqResPGVJElSL9j4SpIkqRdsfCVJktQLNr4LIMk3ktzRTvuSfGvg/vYp\nbue/JrkxyW1Jbkhy3tD8NyS5Jsl3k/z8tLYrbSZdyGuShyb5iyRfSXJrksuSPHRa25Y2i47k9f5J\nPpzkliRfT/IPSR47rW3rQDa+C6Cq7ltVh1fV4cAXgKftv19V75zipi4GTqmqI4HHAs9N8lMD8z8J\nvBj4BOA3n0gr6EhejwTeCzwUOBb4GPAXU9y2tCl0JK/fAH4B+L6qOgq4AHhfEnu0DbB13gWoO6rq\n2oG7AfYBDxmY/4cASf5lxqVJGrJaXqvq48DH75qZvBr4jSRHV9XXZlqopHF5/VfgWoC22d0HHA3c\nD7hltpVufr6b2ISSvCzJ10ZMX53guXcAu4HDgHfMpGipp2aU1ycAX7TpldZnI/Oa5Crg2zRnZ95Y\nVTa9G8DGdxOqqt+rqqNHTPeb4LmHA48G3gbcPpOipZ7a6LwmOQG4EPjVDXkBUo9sZF6r6lTgcOA5\nwIc36jX0nY2vVlRVn6R55/lb865F0upG5TXJ9wJ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_data" } ], "source": [ "init = 0\n", "k = 10\n", "Ts = [k*d + 1 + i for i in range(2*d)]\n", "num_reps = 10**2\n", "dists = cross_sectional_dist(mc2, T=Ts, init=init, num_reps=num_reps)\n", "\n", "fig, axes = plt.subplots(2, d, figsize=(12, 6))\n", "for dist, T, ax in zip(dists, Ts, axes.flatten()):\n", " draw_histogram(dist, ax=ax,\n", " title='T = {T}'.format(T=T))\n", "fig.suptitle('Cross sectional distributions with init={init}'.format(init=init),\n", " y=0.05, fontsize=12)\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Compare these with the rows of $P^{10d+1}, \\ldots, P^{10d+d}$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3: Nearly completely decomposable chain" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Consider the Markov chain given by the following stochastic matrix $P^{\\varepsilon}$,\n", "parameterized by $\\varepsilon$:" ] }, { "cell_type": "code", "execution_count": 74, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def P_epsilon(eps, p=0.5):\n", " P = np.array([[1-(p+eps), p, eps],\n", " [p, 1-(p+eps), eps],\n", " [eps, eps, 1-2*eps]])\n", " return P" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If $\\varepsilon = 0$,\n", "then the Markovh chain is reducible into two recurrent classes, [0, 1] and [2]:" ] }, { "cell_type": "code", "execution_count": 75, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([[ 0.5, 0.5, 0. ],\n", " [ 0.5, 0.5, 0. ],\n", " [ 0. , 0. , 1. ]])" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P_epsilon(0)" ] }, { "cell_type": "code", "execution_count": 76, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[array([0, 1]), array([2])]" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "MarkovChain(P_epsilon(0)).recurrent_classes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If $\\varepsilon > 0$ but small, the chain is irreducible,\n", "but transition within each of the subsets [0, 1] and [2] is much more likely\n", "than that between these sets." ] }, { "cell_type": "code", "execution_count": 77, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "array([[ 0.499, 0.5 , 0.001],\n", " [ 0.5 , 0.499, 0.001],\n", " [ 0.001, 0.001, 0.998]])" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P_epsilon(0.001)" ] }, { "cell_type": "code", "execution_count": 78, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[array([0, 1, 2])]" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "MarkovChain(P_epsilon(0.001)).recurrent_classes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Analytically, the unique stationary distribution of the chain with $\\varepsilon > 0$\n", "is (1/3, 1/3, 1/3), independent of the value of $\\varepsilon$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "However,\n", "for such matrices with small values of $\\varepsilon > 0$,\n", "general purpose eigenvalue solvers are numerically unstable.\n", "\n", "For example, if we use [numpy.linalg.eig](http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.eig.html)\n", "to compute the eigenvector that corresponds\n", "to the dominant (i.e., largest in magnitude) eigenvalue:" ] }, { "cell_type": "code", "execution_count": 79, "metadata": { "collapsed": true }, "outputs": [], "source": [ "np.set_printoptions(precision=15) # Increase the number of digits printed" ] }, { "cell_type": "code", "execution_count": 80, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "epsilon = 1e-12\n", "[ 0.33333662324477 0.33333662324477 0.333326753510459]\n", "epsilon = 1e-13\n", "[ 0.333344849397111 0.333344849397111 0.333310301205779]\n", "epsilon = 1e-14\n", "[ 0.333000773366967 0.333000773366967 0.333998453266065]\n", "epsilon = 1e-15\n", "[ 0.329141015582661 0.329141015582661 0.341717968834677]\n", "epsilon = 1e-16\n", "[ 0.5 0.5 0. ]\n", "epsilon = 1e-17\n", "[ 0.5 0.5 0. ]\n" ] } ], "source": [ "epsilons = [float('1e-{i}'.format(i=i)) for i in range(12, 18)]\n", "for eps in epsilons:\n", " print('epsilon = {eps}'.format(eps=eps))\n", " w, v = np.linalg.eig(P_epsilon(eps).T)\n", " i = w.argmax()\n", " print(v[:, i]/v[:, i].sum())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The output becomes farther from the actual stationary distribution (1/3, 1/3, 1/3)\n", "as $\\varepsilon$ becomes smaller." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The same applies to [scipy.linalg.eig](http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eig.htm):" ] }, { "cell_type": "code", "execution_count": 81, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "epsilon = 1e-12\n", "[ 0.33333662324477 0.33333662324477 0.333326753510459]\n", "epsilon = 1e-13\n", "[ 0.333344849397131 0.333344849397131 0.333310301205738]\n", "epsilon = 1e-14\n", "[ 0.333883550460886 0.333883550460886 0.332232899078228]\n", "epsilon = 1e-15\n", "[ 0.329141015582661 0.329141015582661 0.341717968834677]\n", "epsilon = 1e-16\n", "[ 0.344742003948057 0.344742003948057 0.310515992103886]\n", "epsilon = 1e-17\n", "[ 0.523579944426163 0.523579944426163 -0.047159888852327]\n" ] } ], "source": [ "import scipy.linalg\n", "\n", "for eps in epsilons:\n", " print('epsilon = {eps}'.format(eps=eps))\n", " w, v = scipy.linalg.eig(P_epsilon(eps), left=True, right=False)\n", " i = w.argmax()\n", " print(v[:, i]/v[:, i].sum())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "MarkovChain in quantecon employs\n", "the algorithm called the \"[GTH algorithm](http://quanteconpy.readthedocs.org/en/stable/markov/gth_solve.html)\",\n", "which is a numerically stable variant of Gaussian elimination,\n", "specialized for Markov chains." ] }, { "cell_type": "code", "execution_count": 82, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "epsilon = 1e-12\n", "[ 0.333333333333333 0.333333333333333 0.333333333333333]\n", "epsilon = 1e-13\n", "[ 0.333333333333333 0.333333333333333 0.333333333333333]\n", "epsilon = 1e-14\n", "[ 0.333333333333333 0.333333333333333 0.333333333333333]\n", "epsilon = 1e-15\n", "[ 0.333333333333333 0.333333333333333 0.333333333333333]\n", "epsilon = 1e-16\n", "[ 0.333333333333333 0.333333333333333 0.333333333333333]\n", "epsilon = 1e-17\n", "[ 0.333333333333333 0.333333333333333 0.333333333333333]\n", "epsilon = 1e-100\n", "[ 0.333333333333333 0.333333333333333 0.333333333333333]\n" ] } ], "source": [ "for eps in epsilons + [1e-100]:\n", " print('epsilon = {eps}'.format(eps=eps))\n", " print(MarkovChain(P_epsilon(eps)).stationary_distributions[0])" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "It succeeds in obtaining the correct stationary distribution for any value of $\\varepsilon$." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "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.5.1" } }, "nbformat": 4, "nbformat_minor": 0 }