Skip to content

Reinstate the GMM estimator, once its standard errors are trustworthy #10

Description

@jhollway

Parked on feature/gmm-estimator while the architecture settles. Reinstate with git revert 1113795.

Why it was parked

This one is parked because it looks wrong, not only because it is unused.

Every GMM family — binomial, poisson, negbin, zip — warns:

The covariance matrix of the coefficients is singular

on well-conditioned simulated data with real signal and no collinearity. The estimator still returns coefficients, so a test that only checks the shape passes. A singular covariance matrix means the standard errors are not what they claim to be, and the t-statistics built from them feed straight into the permutation comparison.

It cost 68 lines in fit_qap_model() plus all 111 lines of R/qap_gmm.R, and the estimator control existed only to select it.

What it needs before coming back

  • Find out why the covariance is singular. Likely candidates: the moment conditions in R/qap_gmm.R are over-identified, or gmm::gmm() needs a different weighting matrix, or the extra dispersion parameter for negbin and zip is not being handled.
  • Tests comparing the GMM coefficients against the corresponding maximum-likelihood fit, which should agree closely on well-behaved data.
  • A note in the documentation saying when a user should prefer GMM over the standard estimator. That is not currently stated anywhere.

Order

Fourth. Independent of the engine merge, so it can wait, but it is a correctness question rather than a dependency one, so it should not be reinstated as-is.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions