{ "metadata": { "name": "", "signature": "sha256:6e47c95f7384cc6b0fa5e15f4cbc90289254f6d716d25f7dc725d7f07c50879b" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "import platform\n", "platform.platform()" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 1, "text": [ "'Darwin-13.3.0-x86_64-i386-64bit'" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "import sys\n", "print sys.version" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "2.7.8 (default, Jul 2 2014, 10:14:46) \n", "[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]\n" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy\n", "numpy.__version__" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 3, "text": [ "'1.8.1'" ] } ], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "%run test_mc_compute_stationary.py" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stderr", "text": [ "Elements in each row of P sum to one ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "Elements of v sum to one ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "All the elements of v are nonnegative ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "FAIL\n", "v is a left eigen vector ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "Elements in each row of P sum to one ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "Elements of v sum to one ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "All the elements of v are nonnegative ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "FAIL\n", "v is a left eigen vector ... " ] }, { "output_type": "stream", "stream": "stdout", "text": [ "====\n", "Testing with prameter values set 0\n", "\n", "N = 27 , epsilon = 0.01 , move = sequential \n", "\n", "v =\n", "[ -1.80778809e-02 -2.45277781e-03 -1.60231716e-04 -6.70987087e-06\n", " -2.02307664e-07 -4.67645846e-09 -8.61657871e-11 -1.29886908e-12\n", " -1.62059348e-14 -6.12789737e-17 -7.10381353e-17 -8.20296809e-17\n", " -9.45029769e-17 -1.08779604e-16 -1.25281548e-16 -1.44569891e-16\n", " -1.66831270e-16 -1.17721634e-16 8.30861752e-15 8.04483364e-13\n", " 6.40581297e-11 4.24921050e-09 2.30616264e-07 9.97666012e-06\n", " 3.30892561e-04 7.90171435e-03 1.20957012e-01 8.91497977e-01] \n", "\n", "TOL = 0.01 \n", "\n", "====\n", "Testing with prameter values set 1\n", "\n", "N = 3 , epsilon = 1e-14 , move = sequential \n", "\n", "P =\n", "[[ 1.00000000e+00 5.00000000e-15 0.00000000e+00 0.00000000e+00]\n", " [ 3.33333333e-01 4.99600361e-15 6.66666667e-01 0.00000000e+00]\n", " [ 0.00000000e+00 3.33333333e-15 6.66666667e-01 3.33333333e-01]\n", " [ 0.00000000e+00 0.00000000e+00 5.00000000e-15 1.00000000e+00]] \n", "\n", "v =\n", "[ -1.14942529e-02 -8.51809045e-17 1.49066583e-14 1.01149425e+00] \n", "\n", "TOL = 0.01 \n", "\n", "====" ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "Elements in each row of P sum to one ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "Elements of v sum to one ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "All the elements of v are nonnegative ... " ] }, { "output_type": "stream", "stream": "stderr", "text": [ "FAIL\n", "v is a left eigen vector ... " ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "Testing with prameter values set 2\n", "\n", "N = 5 , epsilon = 1e-15 , move = simultaneous \n", "\n", "P =\n", "[[ 1.00000000e+00 2.50000000e-15 2.50000000e-30 1.25000000e-45\n", " 3.12500000e-61 3.12500000e-77]\n", " [ 1.00000000e+00 2.50000000e-15 2.50000000e-30 1.25000000e-45\n", " 3.12500000e-61 3.12500000e-77]\n", " [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30\n", " 2.77555756e-15 1.00000000e+00]\n", " [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30\n", " 2.77555756e-15 1.00000000e+00]\n", " [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30\n", " 2.77555756e-15 1.00000000e+00]\n", " [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30\n", " 2.77555756e-15 1.00000000e+00]] \n", "\n", "v =\n", "[ -1.00000000e+00 -2.60902411e-15 -5.55111512e-17 -5.55111512e-17\n", " 5.49560397e-15 2.00000000e+00] \n", "\n", "TOL = 0.01 \n", "\n" ] }, { "output_type": "stream", "stream": "stderr", "text": [ "ok\n", "\n", "======================================================================\n", "FAIL: All the elements of v are nonnegative\n", "----------------------------------------------------------------------\n", "Traceback (most recent call last):\n", " File \"/usr/local/lib/python2.7/site-packages/nose/case.py\", line 197, in runTest\n", " self.test(*self.arg)\n", " File \"/Users/oyama/Dropbox/Documents/Teaching/Zemi/2014/test_mc_compute_stationary/test_mc_compute_stationary.py\", line 161, in __call__\n", " eq_(np.prod(v >= 0-TOL), 1)\n", "AssertionError: 0 != 1\n", "\n", "======================================================================\n", "FAIL: All the elements of v are nonnegative\n", "----------------------------------------------------------------------\n", "Traceback (most recent call last):\n", " File \"/usr/local/lib/python2.7/site-packages/nose/case.py\", line 197, in runTest\n", " self.test(*self.arg)\n", " File \"/Users/oyama/Dropbox/Documents/Teaching/Zemi/2014/test_mc_compute_stationary/test_mc_compute_stationary.py\", line 161, in __call__\n", " eq_(np.prod(v >= 0-TOL), 1)\n", "AssertionError: 0 != 1\n", "\n", "======================================================================\n", "FAIL: All the elements of v are nonnegative\n", "----------------------------------------------------------------------\n", "Traceback (most recent call last):\n", " File \"/usr/local/lib/python2.7/site-packages/nose/case.py\", line 197, in runTest\n", " self.test(*self.arg)\n", " File \"/Users/oyama/Dropbox/Documents/Teaching/Zemi/2014/test_mc_compute_stationary/test_mc_compute_stationary.py\", line 161, in __call__\n", " eq_(np.prod(v >= 0-TOL), 1)\n", "AssertionError: 0 != 1\n", "\n", "----------------------------------------------------------------------\n", "Ran 12 tests in 0.070s\n", "\n", "FAILED (failures=3)\n" ] }, { "ename": "SystemExit", "evalue": "True", "output_type": "pyerr", "traceback": [ "An exception has occurred, use %tb to see the full traceback.\n", "\u001b[0;31mSystemExit\u001b[0m\u001b[0;31m:\u001b[0m True\n" ] } ], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }