code: def moment_exponential_mult(params, data, exp=True):
      # multiplicative error model
  
      endog = data[:, 0]
      exog = data[:, 1:]
  
      if not np.isfinite(params).all():
          print("invalid params", params)
  
      # moment condition without instrument
      if exp:
          predicted = np.exp(np.dot(exog, params))
          predicted = np.clip(predicted, 0, 1e100)  # avoid inf
          resid = endog / predicted - 1
          if not np.isfinite(resid).all():
              print("invalid resid", resid)
  
      else:
          resid = endog - np.dot(exog, params)
  
      return resid
  
imports: from statsmodels.compat.python import lmap
  import numpy
  import pandas
  from scipy import stats
  import pytest
  from statsmodels.regression.linear_model import OLS
  from statsmodels.sandbox.regression import gmm
  from numpy.testing import assert_allclose, assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: moment_exponential_mult(params, data, exp) and returns: resid