Skip to content

REF/ENH: GMM refactor cov_type #2495

Open

Description

@josef-pkt

GMMResults defines cov_params method that is inconsistent with inherited method and breaks t_test. #2446

just using the inherited cov_params and renaming the current GMMResults cov_params breaks the unit tests.

The missing piece is an official way to set the cov_type and the corresponding cov_params_default. The best, I guess, would be to follow the newer pattern with cov_type in fit.

The question is what keywords to use. The structure for the options is rather different from the (quasi)-likelihoodmodels

  • default GMM: We always have sandwiches, definition depends on whether we used the optimial weighting matrix, and what we use for the covariance of the moment conditions ("meat").

cases:

  • (assumed) optimal weighting matrix -> cov_type needs to follow the same options as weighting matrix (no extra options available ?)
  • exactly identified -> weighting matrix is irrelevant (except for numerical properties), we need assumptions for covariance of moment conditions.
  • suboptimial weighting matrix -> need separate options for weighting matrix and cov_type. cov_type is "double sandwich" and we need assumptions for covariance of moment conditions.

This means we need a separate cov_type argument, additional to weighting matrix (weights_method) and has_optimal_weights, for the latter two cases.

and we need weights_kwds and cov_kwds for cluster and hac, and panel, ...

(Stata gmm has separate wmatrix(wmtype, wmoptions) and vce(vcetype, vceoptions))

Activity

  1. added this to the 0.8 milestone on Jul 2, 2015
  2. josef-pkt commented on Jul 2, 2015

    @josef-pkt
    MemberAuthor

    to replicate OLS results with GMM, we also need to define df_resid and allow use_t = True. Currently it looks like df_resid is set to inf, which breaks in t_test (pvalues are all 1.)

    current hack in #2497 to get t distribution p-values is (last two lines in the following)

            mod = gmm.LinearIVGMM(endog, exog, exog)
            res = mod.fit(start, maxiter=0, inv_weights=w0inv,
                            #optim_method='bfgs', optim_args={'gtol':1e-6, 'disp': 0},
                            optim_args={'disp': 0},
                            weights_method='iid',
                            wargs={'centered':False, 'ddof':'k_params'},
                            has_optimal_weights=True)
            res.use_t = True
            res.df_resid = res.nobs - len(res.params)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions