def mackinnoncrit(N=1, regression='c', nobs=inf):
 reg = regression
 if (reg not in ['c', 'ct', 'nc', 'ctt']):
  raise (ValueError('regression keyword %s not understood') % reg)
 if (nobs is inf):
  return eval((((('tau_' + reg) + '_2010[') + str((N - 1))) + ',:,0]'))
 else:
  return polyval(eval((((('tau_' + reg) + '_2010[') + str((N - 1))) + ',:,::-1].T')), (1.0 / nobs))

def mackinnoncrit ( N = 1 , regression = 'c' , nobs = inf ) : reg = regression if ( reg not in [ 'c' , 'ct' , 'nc' , 'ctt' ] ) : raise ( ValueError ( 'regression keyword %s not understood' ) % reg ) if ( nobs is inf ) : return eval ( ( ( ( ( 'tau_' + reg ) + '_2010[' ) + str ( ( N - 1 ) ) ) + ',:,0]' ) ) else : return polyval ( eval ( ( ( ( ( 'tau_' + reg ) + '_2010[' ) + str ( ( N - 1 ) ) ) + ',:,::-1].T' ) ) , ( 1.0 / nobs ) )
returns the critical values for cointegrating and the adf test .