gmm
Estimate parameters using generalized method of moments for arbitrary moment conditions. Returns robust standard errors and diagnostics for evidence-backed decisions.
Instructions
General GMM estimator for arbitrary moment conditions. Validation: validated evidence tier (known-truth, reference, external-parity, or Monte Carlo artifact).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| W | No | Weighting matrix ``(q, q)`` for the first step. Defaults to the identity. Supplying one and asking for ``se='unadjusted'`` warns unless it happens to be efficient. | |
| se | No | ``'robust'`` returns the sandwich, valid for any ``W``. ``'unadjusted'`` returns the efficient-GMM variance ``(D'WD)^{-1}/n``, which describes the estimator *only* at the efficient weight; otherwise it warns. | robust |
| tol | No | Numerical convergence tolerance. | |
| vcov | No | Estimator for the moment covariance ``S``. | mds |
| alpha | No | Significance level for confidence intervals and tests. | |
| center | No | Centre the moments before forming ``S``. ``False`` matches Stata, ``True`` matches R's ``gmm``. | |
| detail | No | Payload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip. | agent |
| method | No | Estimator or algorithm variant to use. | twostep |
| theta0 | Yes | Starting values. Also the expansion point for the closed form when the moments are affine. | |
| cluster | No | Group labels, one per moment row. Required when ``vcov='cluster'``. | |
| maxiter | No | maxiter parameter (int). | |
| jacobian | No | ``D(theta, data) -> ndarray`` of shape ``(q, k)``, the derivative of the *average* moment. Supplying it removes finite-difference error from the standard errors and from the affine test. | |
| as_handle | No | If true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running. | |
| data_path | No | Absolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://. | |
| moment_fn | Yes | ``g(theta, data) -> ndarray`` of shape ``(n, q)``: the moment contribution of each observation. | |
| result_id | No | Optional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns. | |
| param_names | No | param_names parameter (Optional[List[str]]). | |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. | |
| hac_bandwidth | No | Bartlett bandwidth for ``vcov='hac'``; the kernel vanishes at ``lag == hac_bandwidth``. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||