Python 中的广义矩估计方法

Generalized Method of Moments Estimation in Python

我正在尝试在 Python 中执行工具变量 (IV) 回归。我在网上看到 statsmodels.gmm 包有我需要的功能 (http://statsmodels.sourceforge.net/devel/gmm.html#),但是当我 运行 import statsmodels.gmm as gmm in Python 我得到这个错误 No module named gmm .我正在使用 ipython 和 python 2.7.9。任何建议将不胜感激。

GMM 和相关的 IV 估计器仍在沙盒中,尚未包含在统计模型中 API。

需要直接从模块导入

from statsmodels.sandbox.regression import gmm

然后,这些 类 可以访问,例如 gmm.GMM

目前可用的主要型号有:

GMMIV2SLSIVGMMLinearIVGMMNonlinearIVGMM

邮件列表最近讨论了当前状态,并链接到 "secret" Gists https://groups.google.com/d/msg/pystatsmodels/o6NY7qGrPw0/vzf897jy3vMJ

(我刚刚发现 t_test 不适用于 GMM 模型。)