Skip to main content

Module econometrics

Module econometrics 

Source
Expand description

Econometrics: OLS, WLS, 2SLS, logistic MLE, GMM, and calibration records.

Allocation class: HotZeroHeap. All scratch uses fixed-capacity stack arrays. No Vec/String/Box in any kernel.

Assumptions:

  • OLS assumes exogeneity (E[ε|X] = 0), iid errors, no perfect multicollinearity. Standard errors are not yet computed (future work).
  • WLS assumes known weights proportional to inverse error variance.
  • 2SLS assumes instrument relevance (n_instr >= n_reg) and exogeneity. Underidentified models (n_instr < n_reg) are refused.
  • Logistic MLE assumes iid Bernoulli outcomes with logit link; uses Newton-Raphson (IRLS).

Structs§

CalibrationRecord
A repr(C) calibration record linking a fitted model to its data and diagnostics.

Enums§

EconometricsError

Constants§

MAX_OBSERVATIONS
Maximum observations in a bounded regression.
MAX_REGRESSORS
Maximum regressors (including constant) in a bounded regression.

Functions§

gmm_moment_eval
Evaluate GMM moment conditions: g(theta) = (1/n) sum m_i(theta).
iv_2sls_into
Two-Stage Least Squares (2SLS).
logistic_mle_into
Logistic regression via Newton-Raphson (IRLS).
ols_into
Ordinary Least Squares via normal equations X'X b = X'y.
wls_into
Weighted Least Squares: (X'WX) b = X'Wy.