#NEWLINE# def test_compare_discrete( self ) : #NEWLINE# #INDENT# res1 = self . res1 #NEWLINE# resd = self . resd #NEWLINE# assert_allclose ( res1 . llf , resd . llf , rtol = 1e-10 ) #NEWLINE# score_obs1 = res1 . model . score_obs ( res1 . params ) #NEWLINE# score_obsd = resd . model . score_obs ( resd . params ) #NEWLINE# assert_allclose ( score_obs1 , score_obsd , rtol = 1e-10 ) #NEWLINE# score1 = res1 . model . score ( res1 . params ) #NEWLINE# assert_allclose ( score1 , score_obs1 . sum ( 0 ) , atol = 1e-20 ) #NEWLINE# assert_allclose ( score1 , np . zeros ( score_obs1 . shape [ 1 ] ) , atol = 1e-07 ) #NEWLINE# hessian1 = res1 . model . hessian ( res1 . params , observed = False ) #NEWLINE# hessiand = resd . model . hessian ( resd . params ) #NEWLINE# assert_allclose ( hessian1 , hessiand , rtol = 1e-10 ) #NEWLINE# hessian1 = res1 . model . hessian ( res1 . params , observed = True ) #NEWLINE# hessiand = resd . model . hessian ( resd . params ) #NEWLINE# assert_allclose ( hessian1 , hessiand , rtol = 1e-09 )