Functions to solve for parameters
for some function
Look in the notebooks/
directory for examples of how to use the library.
pip install git+https://github.com/py-econometrics/gmm --extra-index-url https://download.pytorch.org/whl/cpu
where the --extra-index-url
sources the torch
dependency. Swap it for the GPU version if you have a CUDA-compatible GPU.
solves for a k-dimensional parameter
for a moment condition
Supports both scipy.optimize.minimize
and pytorch.minimize
to solve the GMM for just- and over-identified problems (with Identity or Optimal weight matrix) and computes HAC-robust standard errors. See OLS and IV examples in example.ipynb
, and several maximum likelihood examples in maximum_likelihood.ipynb
.
The scipy optimizer uses an analytic expression for the jacobian of linear moment conditions, while the pytorch.minimize
version uses forward-mode autodiff and therefore supports both linear and non-linear moment conditions.
Solves the same category of problem using generalized empirical likelihood (Exponential tilting by default, but also supports EL and CUE) by solving the following optimization problem
where
where
- Empirical Likelihood:
$\rho(v) = log(1 - v)$ - Exponential tilting:
$\rho(v) = 1 - \exp(v)$ - Continuously Updated (CU) GMM:
$\rho(v) = -(1/2)v^2 - v$
- Support numerical optimization via pytorch-minimize
- Support Empirical Likelihood and Generalized Empirical Likelihood
- Support bootstrapping influence functions ('fast bootstrap') for inference
- Support for autodiff-based gradients in
GEL
- Refactor
GMM
estimators to accept a single data argument instead of separate X, y, z, etc.
-
Microeconometrics [Chapter 6], Cameron and Trivedi
-
Imbens, Generalized Method of Moments and Empirical Likelihood
-
Guido Imbens' lectures
-
Anatolyev and Gospodinov, Methods for Estimation and Inference in Modern Econometrics
-
Owen, Empirical Likelihood
-
Newey and Smith, Higher Order Properties of GMM and Generalized Empirical Likelihood Estimators
-
here be gremlins: Newey and McFadden (1994)
-
here be dragons :Van Der Vaart, Asymptotic Statistics