Unittest for stoch_eig with KMR matrices

Test 1


In [1]:
# Default values: N=27, epsilon=1e-2, move='sequential', tolerance=0
%run unittest_numpy_eigen_markov.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 =
[  1.78461892e-21   2.42134225e-22   1.58178137e-23   6.62387508e-25
   1.99714827e-26   4.61652363e-28   8.50615744e-30   1.28233529e-31
   1.61097399e-33   1.70901763e-35   6.12170115e-33   1.88270136e-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

Test 2


In [2]:
%run unittest_numpy_eigen_markov.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 =
[  5.00000000e-15   7.50000000e-29   1.50000000e-14   1.00000000e+00] 

TOL = 0 

ok

----------------------------------------------------------------------
Ran 4 tests in 0.002s

OK

Test 3


In [3]:
%run unittest_numpy_eigen_markov.py --move='simultaneous' --N=5 --epsilon=1e-15


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 =
[  1.89911355e-31   4.74778387e-46   1.71056941e-45   3.08148791e-30
   2.77555756e-15   1.00000000e+00] 

TOL = 0 

ok

----------------------------------------------------------------------
Ran 4 tests in 0.002s

OK

In [4]:
import platform
print platform.platform()


Darwin-13.3.0-x86_64-i386-64bit

In [5]:
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)]

In [6]:
import numpy
print numpy.__version__


1.8.1

In [6]: