3.2.1.1.2. statsmodels.discrete.discrete_margins.margeff_cov_params

statsmodels.discrete.discrete_margins.margeff_cov_params(model, params, exog, cov_params, at, derivative, dummy_ind, count_ind, method, J)[source]

Computes the variance-covariance of marginal effects by the delta method.

Parameters:

model : model instance

The model that returned the fitted results. Its pdf method is used for computing the Jacobian of discrete variables in dummy_ind and count_ind

params : array-like

estimated model parameters

exog : array-like

exogenous variables at which to calculate the derivative

cov_params : array-like

The variance-covariance of the parameters

at : str

Options are:

  • ‘overall’, The average of the marginal effects at each observation.
  • ‘mean’, The marginal effects at the mean of each regressor.
  • ‘median’, The marginal effects at the median of each regressor.
  • ‘zero’, The marginal effects at zero for each regressor.
  • ‘all’, The marginal effects at each observation.

Only overall has any effect here.you

derivative : function or array-like

If a function, it returns the marginal effects of the model with respect to the exogenous variables evaluated at exog. Expected to be called derivative(params, exog). This will be numerically differentiated. Otherwise, it can be the Jacobian of the marginal effects with respect to the parameters.

dummy_ind : array-like

Indices of the columns of exog that contain dummy variables

count_ind : array-like

Indices of the columns of exog that contain count variables

Notes

For continuous regressors, the variance-covariance is given by

Asy. Var[MargEff] = [d margeff / d params] V [d margeff / d params]’

where V is the parameter variance-covariance.

The outer Jacobians are computed via numerical differentiation if derivative is a function.