SPB Git

spb/metrika Public

Stata-class statistics, GPU-accelerated by Apple Silicon. Native Swift — no Electron, no Python runtime, no compromises.

Swift 92.4% HTML 3.3% R 3% Shell 1.3%

History of MetrikaKit/Tests/MetrikaKitTests/PredictTests.swift · clear filter

  1. feat(engine): predict with estimation state (e() analog)
    - PredictorDefinition (column / indicator / product / constant) records
      how each fitted regressor is recomputed from the dataset; threaded
      through buildRegressionSample so factor expansions and interactions
      carry their recipes
    - EstimationState stored after regress, logit/probit/poisson, and
      ivregress; cleared after xtreg (predict there needs the estimated u_i)
    - predict newvar [, xb | residuals | pr | n]: evaluates over ALL current
      observations with missing propagation; kind-aware defaults (xb for
      ols/iv, pr for logit/probit, n for poisson) and statistic validation
    - ZQFactorExpansion.expand now returns the numeric level alongside each
      indicator column
    - tests: xb + residuals reconstruct the response exactly (plain and
      factor models), mean fitted probability/count equals ybar (score
      equations), option validation; 93 green
    
    Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
    simon-pierre boucher committed 6 days ago (Aug 5, 2026) · 1 file changed +103