Bug#1079789: statsmodels: tests fail on arm64 with scipy 1.14

Drew Parsons dparsons at debian.org
Tue Aug 27 12:53:26 BST 2024


Source: statsmodels
Version: 0.14.2+dfsg-1
Severity: normal
Control: forwarded -1 https://github.com/statsmodels/statsmodels/issues/7866

statsmodels is failing tests on arm64 with scipy 1.14 (from
experimental)

1504s ______________ TestZeroInflatedModel_probit.test_fit_regularized _______________
1504s 
1504s self = <statsmodels.discrete.tests.test_count_model.TestZeroInflatedModel_probit object at 0xffff91ad24e0>
1504s 
1504s     @pytest.mark.skipif(PLATFORM_LINUX32, reason="Fails on 32-bit Linux")
1504s     def test_fit_regularized(self):
1504s >       super().test_fit_regularized()
1504s 
1504s /usr/lib/python3/dist-packages/statsmodels/discrete/tests/test_count_model.py:114: 
1504s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1504s /usr/lib/python3/dist-packages/statsmodels/discrete/tests/test_count_model.py:50: in test_fit_regularized
1504s     assert_allclose(res_reg.params[2:], self.res1.params[2:],
1504s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
1504s 
1504s args = (<function assert_allclose.<locals>.compare at 0xffff8c1b8540>, array([ 0.        ,  0.        , -0.02679517,  1.48236838]), array([-0.08217884,  0.00856726, -0.02679518,  1.48236911]))
1504s kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0.05, atol=0.05', 'verbose': True}
1504s 
1504s     @wraps(func)
1504s     def inner(*args, **kwds):
1504s         with self._recreate_cm():
1504s >           return func(*args, **kwds)
1504s E           AssertionError: 
1504s E           Not equal to tolerance rtol=0.05, atol=0.05
1504s E           
1504s E           Mismatched elements: 1 / 4 (25%)
1504s E           Max absolute difference: 0.08217884
1504s E           Max relative difference: 1.
1504s E            x: array([ 0.      ,  0.      , -0.026795,  1.482368])
1504s E            y: array([-0.082179,  0.008567, -0.026795,  1.482369])
1504s 
1504s /usr/lib/python3.12/contextlib.py:81: AssertionError


Full test log at
https://ci.debian.net/packages/s/statsmodels/unstable/arm64/51043990/


The problem was previously acknowledged upstream at
https://github.com/statsmodels/statsmodels/issues/7866
where the recommendation was
"The zeroinflated test can be skipped, fit_regularized for ZI model is
inherited, and I never checked how robust optimization is in those
cases. Starting values for optimization are not very good yet."



More information about the debian-science-maintainers mailing list