In [1]:
import platform
platform.platform()
Out[1]:
'Darwin-10.8.0-i386-64bit'
In [2]:
import sys
print sys.version
2.7.6 (default, Feb 24 2014, 09:53:59)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
In [3]:
import numpy
numpy.__version__
Out[3]:
'1.8.0'
In [4]:
# Default values: N=27, epsilon=1e-2, move='sequential', tolerance=1e-2
%run unittest_mc_compute_stationary.py
test_left_eigen_vec (__main__.TestComputeStationary) ... ok
test_markov_matrix (__main__.TestComputeStationary) ... ok
test_nonnegative (__main__.TestComputeStationary) ... FAIL
test_sum_one (__main__.TestComputeStationary) ...
N = 27 , epsilon = 0.01
v =
[ -1.88568573e-02 -2.55846807e-03 -1.67136105e-04 -6.99899937e-06
-2.11025107e-07 -4.87796717e-09 -8.98786730e-11 -1.35483738e-12
-1.69042488e-14 -6.39194809e-17 -7.40955589e-17 -8.55722397e-17
-9.85973897e-17 -1.13501133e-16 -1.30026937e-16 -1.49343124e-16
-1.71629892e-16 -1.21574765e-16 8.31176299e-15 8.05182291e-13
6.41140988e-11 4.25292338e-09 2.30817772e-07 9.98537756e-06
3.31181689e-04 7.90861874e-03 1.21062702e-01 8.92276953e-01]
TOL = 0.01
ok
======================================================================
FAIL: test_nonnegative (__main__.TestComputeStationary)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Volumes/HD1/Users/oyama/Dropbox/documents/Teaching/Zemi/2014/test_mc_compute_stationary/unittest_mc_compute_stationary.py", line 129, in test_nonnegative
self.assertEqual(np.prod(self.v >= 0-TOL), 1)
AssertionError: 0 != 1
----------------------------------------------------------------------
Ran 4 tests in 0.003s
FAILED (failures=1)
In [5]:
%run unittest_mc_compute_stationary.py --N=3 --epsilon=1e-14
test_left_eigen_vec (__main__.TestComputeStationary) ... ok
test_markov_matrix (__main__.TestComputeStationary) ... ok
test_nonnegative (__main__.TestComputeStationary) ... FAIL
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 =
[ -1.14942529e-02 -8.51809045e-17 1.49066583e-14 1.01149425e+00]
TOL = 0.01
ok
======================================================================
FAIL: test_nonnegative (__main__.TestComputeStationary)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Volumes/HD1/Users/oyama/Dropbox/documents/Teaching/Zemi/2014/test_mc_compute_stationary/unittest_mc_compute_stationary.py", line 129, in test_nonnegative
self.assertEqual(np.prod(self.v >= 0-TOL), 1)
AssertionError: 0 != 1
----------------------------------------------------------------------
Ran 4 tests in 0.003s
FAILED (failures=1)
In [6]:
%run unittest_mc_compute_stationary.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) ... FAIL
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.00000000e+00 -2.60902411e-15 -5.55111512e-17 -5.55111512e-17
5.49560397e-15 2.00000000e+00]
TOL = 0.01
ok
======================================================================
FAIL: test_nonnegative (__main__.TestComputeStationary)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Volumes/HD1/Users/oyama/Dropbox/documents/Teaching/Zemi/2014/test_mc_compute_stationary/unittest_mc_compute_stationary.py", line 129, in test_nonnegative
self.assertEqual(np.prod(self.v >= 0-TOL), 1)
AssertionError: 0 != 1
----------------------------------------------------------------------
Ran 4 tests in 0.002s
FAILED (failures=1)
In [6]:
Content source: oyamad/test_mc_compute_stationary
Similar notebooks: