import platform
print platform.platform()
Darwin-13.3.0-x86_64-i386-64bit
import sys
print sys.version
2.7.8 (default, Jul 2 2014, 10:14:46) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]
import numpy
print numpy.__version__
1.8.1
# Default values: N=27, epsilon=1e-2, move='sequential', tolerance=0
%run unittest_mc_compute_stationary_mpmath.py
test_left_eigen_vec (__main__.TestComputeStationary) ... ok test_markov_matrix (__main__.TestComputeStationary) ... ok test_nonnegative (__main__.TestComputeStationary) ... ok test_sum_one (__main__.TestComputeStationary) ...
N = 27 , epsilon = 0.01 v (converted to numpy.float) = [ 1.78067089e-21 2.41598563e-22 1.57828207e-23 6.60922140e-25 1.99273007e-26 4.60631072e-28 8.48733971e-30 1.27949877e-31 1.60743862e-33 1.70776649e-35 6.12168837e-33 1.88270135e-30 4.99543428e-28 1.14702856e-25 2.28258684e-23 3.93670144e-21 5.87552690e-19 7.56560493e-17 8.36419656e-15 7.88435581e-13 6.27594722e-11 4.16304499e-09 2.25939806e-07 9.77435246e-06 3.24182690e-04 7.74148263e-03 1.18504234e-01 8.73420096e-01] TOL = 0
ok ---------------------------------------------------------------------- Ran 4 tests in 0.002s OK
%run unittest_mc_compute_stationary_mpmath.py --N=3 --epsilon=1e-14
test_left_eigen_vec (__main__.TestComputeStationary) ... ok test_markov_matrix (__main__.TestComputeStationary) ... ok test_nonnegative (__main__.TestComputeStationary) ... ok test_sum_one (__main__.TestComputeStationary) ...
N = 3 , epsilon = 1e-14 P = [[ 1.00000000e+00 5.00000000e-15 0.00000000e+00 0.00000000e+00] [ 3.33333333e-01 4.99600361e-15 6.66666667e-01 0.00000000e+00] [ 0.00000000e+00 3.33333333e-15 6.66666667e-01 3.33333333e-01] [ 0.00000000e+00 0.00000000e+00 5.00000000e-15 1.00000000e+00]] v (converted to numpy.float) = [ 5.00079054e-15 7.50039527e-29 1.50000000e-14 1.00000000e+00] TOL = 0
ok ---------------------------------------------------------------------- Ran 4 tests in 0.001s OK
%run unittest_mc_compute_stationary_mpmath.py --move='simultaneous' --N=5 --epsilon=1e-15
test_left_eigen_vec (__main__.TestComputeStationary) ... FAIL test_markov_matrix (__main__.TestComputeStationary) ... ok test_nonnegative (__main__.TestComputeStationary) ... ok test_sum_one (__main__.TestComputeStationary) ...
N = 5 , epsilon = 1e-15 P = [[ 1.00000000e+00 2.50000000e-15 2.50000000e-30 1.25000000e-45 3.12500000e-61 3.12500000e-77] [ 1.00000000e+00 2.50000000e-15 2.50000000e-30 1.25000000e-45 3.12500000e-61 3.12500000e-77] [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00] [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00] [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00] [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00]] v (converted to numpy.float) = [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00] TOL = 0
ok ====================================================================== FAIL: test_left_eigen_vec (__main__.TestComputeStationary) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/oyama/Dropbox/Documents/Teaching/Zemi/2014/test_mc_compute_stationary/unittest_mc_compute_stationary_mpmath.py", line 133, in test_left_eigen_vec self.assertTrue(np.allclose(np.dot(self.v, self.P), self.v, atol=TOL)) AssertionError: False is not true ---------------------------------------------------------------------- Ran 4 tests in 0.002s FAILED (failures=1)
%run unittest_mc_compute_stationary_mpmath.py --move='simultaneous' --N=5 --epsilon=1e-15 --tolerance=1e-17
test_left_eigen_vec (__main__.TestComputeStationary) ... ok test_markov_matrix (__main__.TestComputeStationary) ... ok test_nonnegative (__main__.TestComputeStationary) ... ok test_sum_one (__main__.TestComputeStationary) ...
N = 5 , epsilon = 1e-15 P = [[ 1.00000000e+00 2.50000000e-15 2.50000000e-30 1.25000000e-45 3.12500000e-61 3.12500000e-77] [ 1.00000000e+00 2.50000000e-15 2.50000000e-30 1.25000000e-45 3.12500000e-61 3.12500000e-77] [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00] [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00] [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00] [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00]] v (converted to numpy.float) = [ 5.27109897e-77 4.74778387e-61 1.71056941e-45 3.08148791e-30 2.77555756e-15 1.00000000e+00] TOL = 1e-17
ok ---------------------------------------------------------------------- Ran 4 tests in 0.001s OK
import mpmath
print mpmath.__version__
0.19