Repository navigation
Open
Labels
Description
(some notes to figure out where GMM was left off)
bold and after; update 2015-10-04
required changes:
- fmin method="nm" is not working well enough,
bfgsworks well DONEbfgsdoesn't for plain gamma distribution - code and arguments of methods are inconsistent in use of weights or inverse weights ???* DONE but needs another check
fitis pretty useless without options (e.g. maxiter), DONEfithas been refactored to be main access point
drop it and usefititeras main method? (fititerdoesn't return results instance)calc_weightmatrixis missing kernels, and degrees of freedom or small sample corrections (HCi, HAC)
connect S matrix calculation fromstats.sandwich_covarianceTODO
IVGMM with start_weight = Z' Z (instrument Z) DONE
- 1 iteration: same as IV2SLS (except currently nonlinear optimization)
-
= 2 iterations: should be IV2SLS with nonparametric heteroscedasticity
- option to avoid sandwich cov_params ?
(i.e. assume start_weight is correctly specified optimal weights) - use explicit linear solution in linear regression model
CondGMM TODO? no optimal instruments code
GMM with conditional moment restrictions, similar to IVGMM, but with additional methods to help construct optimal instruments or approximations to them.
(not yet started)
Comparison to Stata Mostly DONE #1105 added test suite against Stata
Since there are so many options it is difficult to figure out how to match reference numbers with Stata.
In some cases, I can match Stata to many digits, in other cases the results are just in the same neighborhood.
- Stata doesn't center moments by default. I do, following the recommendation in Bruce Hansen's textbook
(without centering I can match the params of Stata with HAC weights, but not the standard errors.
Still another option with a different defaults? - Optimal weights or not. According to the Stata manual the cov_params is always estimated under the assumption
of non-optimal weights (W != S^{-1}). My default is to assumehas_optimal_weights=Trueand use S reestimated after the final iteration.
Activity
josef-pkt commentedon Oct 7, 2013
possible bug: has_optimal_weights=False calculation shouldn't have an linalg.inv at the end.
need a test case
josef-pkt commentedon Oct 10, 2013
Comparison with Stata defaults for
gmm twostep wmat(hac nw 4)centered = Falseassume non-optimal weights,
has_optimal_weights=Falselooks close enough given numerical optimization and numerical derivatives
josef-pkt commentedon Oct 4, 2015
Most of the things in the description are outdated, PR #1105 added many fixes, cleanup and enhancements.
One more round of work is necessary to get it out of sandbox.
What is left of the issues raised in the description here?