def margeff_cov_params(model, params, exog, cov_params, at, derivative, dummy_ind, count_ind, method, J):
 if callable(derivative):
  from statsmodels.tools.numdiff import approx_fprime_cs
  params = params.ravel('F')
  try:
   jacobian_mat = approx_fprime_cs(params, derivative, args=(exog, method))
  except TypeError:
   from statsmodels.tools.numdiff import approx_fprime
   jacobian_mat = approx_fprime(params, derivative, args=(exog, method))
  if (at == 'overall'):
   jacobian_mat = np.mean(jacobian_mat, axis=1)
  else:
   jacobian_mat = jacobian_mat.squeeze()
  if (dummy_ind is not None):
   jacobian_mat = _margeff_cov_params_dummy(model, jacobian_mat, params, exog, dummy_ind, method, J)
  if (count_ind is not None):
   jacobian_mat = _margeff_cov_params_count(model, jacobian_mat, params, exog, count_ind, method, J)
 else:
  jacobian_mat = derivative
 return np.dot(np.dot(jacobian_mat, cov_params), jacobian_mat.T)

def margeff_cov_params ( model , params , exog , cov_params , at , derivative , dummy_ind , count_ind , method , J ) : if callable ( derivative ) : from statsmodels . tools . numdiff import approx_fprime_cs params = params . ravel ( 'F' ) try : jacobian_mat = approx_fprime_cs ( params , derivative , args = ( exog , method ) ) except TypeError : from statsmodels . tools . numdiff import approx_fprime jacobian_mat = approx_fprime ( params , derivative , args = ( exog , method ) ) if ( at == 'overall' ) : jacobian_mat = np . mean ( jacobian_mat , axis = 1 ) else : jacobian_mat = jacobian_mat . squeeze ( ) if ( dummy_ind is not None ) : jacobian_mat = _margeff_cov_params_dummy ( model , jacobian_mat , params , exog , dummy_ind , method , J ) if ( count_ind is not None ) : jacobian_mat = _margeff_cov_params_count ( model , jacobian_mat , params , exog , count_ind , method , J ) else : jacobian_mat = derivative return np . dot ( np . dot ( jacobian_mat , cov_params ) , jacobian_mat . T )
computes the variance-covariance of marginal effects by the delta method .