statsmodels/statsmodels — Issue #150: precision in test_discrete.TestPoissonNewton.test_jac ?
Author: josef-pkt
Created: 2012-02-28 16:37:43+00:00
State: open
Labels: comp-discrete

I wrote the tests in python 2.6 with numpy 1.5.1, running the tests with python 2.7 and same numpy version, I get a precision error in test_discrete.TestPoissonNewton.test_jac

Since score is just the sum of jac, the lower precision is a bit surprising. -> investigate

```
======================================================================
FAIL: scikits.statsmodels.discrete.tests.test_discrete.TestPoissonNewton.test_jac
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\Josef\testing\tox\py27a\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "E:\Josef\testing\tox\py27a\lib\site-packages\scikits\statsmodels\discrete\tests\test_discrete.py", line 101, in test_jac
assert_almost_equal(jacsum, score, DECIMAL_10) #Poisson has low precision ?
File "E:\Josef\testing\tox\py27a\lib\site-packages\numpy\testing\utils.py", line 447, in assert_almost_equal
return assert_array_almost_equal(actual, desired, decimal, err_msg)
File "E:\Josef\testing\tox\py27a\lib\site-packages\numpy\testing\utils.py", line 774, in assert_array_almost_equal
header='Arrays are not almost equal')
File "E:\Josef\testing\tox\py27a\lib\site-packages\numpy\testing\utils.py", line 618, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal

(mismatch 20.0%)
x: array([-0.00000002, -0. , -0.00000007, -0.00000004, -0.00000001,
-0.0000004 , 0. , -0. , -0.00000002, -0.00000002])
y: array([-0.00000002, -0. , -0.00000007, -0.00000004, -0.00000001,
-0.00000039, -0. , -0. , -0.00000002, -0.00000002])
```