#NEWLINE# @ classmethod #NEWLINE# def setup_class( self ) : #NEWLINE# #INDENT# XLISTEXOG2 = 'aget aget2 educyr actlim totchr' . split ( ) #NEWLINE# endog_name = 'docvis' #NEWLINE# exog_names = ( ( 'private medicaid' . split ( ) + XLISTEXOG2 ) + [ 'const' ] ) #NEWLINE# instrument_names = ( ( 'income medicaid ssiratio' . split ( ) + XLISTEXOG2 ) + [ 'const' ] ) #NEWLINE# endog = DATA [ endog_name ] #NEWLINE# exog = DATA [ exog_names ] #NEWLINE# instrument = DATA [ instrument_names ] #NEWLINE# asarray = ( lambda x : np . asarray ( x , float ) ) #NEWLINE# ( endog , exog , instrument ) = lmap ( asarray , [ endog , exog , instrument ] ) #NEWLINE# endog_ = np . zeros ( len ( endog ) ) #NEWLINE# exog_ = np . column_stack ( ( endog , exog ) ) #NEWLINE# self . bse_tol = [ 0.0005 , 5e-05 ] #NEWLINE# self . params_tol = [ 5e-05 , 5e-05 ] #NEWLINE# q_tol = [ 5e-05 , 1e-08 ] #NEWLINE# start = OLS ( endog , exog ) . fit ( ) . params #NEWLINE# ( nobs , k_instr ) = instrument . shape #NEWLINE# w0inv = ( np . dot ( instrument . T , instrument ) / nobs ) #NEWLINE# mod = gmm . NonlinearIVGMM ( endog_ , exog_ , instrument , moment_exponential_mult ) #NEWLINE# res0 = mod . fit ( start , maxiter = 2 , inv_weights = w0inv , optim_method = 'bfgs' , optim_args = { #NEWLINE# #INDENT# 'gtol' : 1e-08 , #NEWLINE# 'disp' : 0 , #NEWLINE# #UNINDENT# } , wargs = { #NEWLINE# #INDENT# 'centered' : True , #NEWLINE# #UNINDENT# } , has_optimal_weights = False ) #NEWLINE# self . res1 = res0 #NEWLINE# from . results_gmm_poisson import results_multtwostepcenter as results #NEWLINE# self . res2 = results