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/Sources/ZQGPU/PhiloxStream.swift · clear filter

  1. feat(stats): Bayesian linear regression via Gibbs sampling (bayes prefix)
    - PhiloxStream in ZQGPU: sequential variate stream over a dedicated
      counter block (bit 62 + per-stream 2^48 words, disjoint from bootstrap
      and permutation streams); Box-Muller normals, Marsaglia-Tsang gammas
      (moments verified against theory at 200k draws)
    - ZQBayesianRegression: semi-conjugate Gibbs with Stata bayes default
      priors (coefficients N(0, 10000), variance InvGamma(.01, .01)); exact
      full conditionals via dense Cholesky; posterior mean/sd and
      equal-tailed 95% credible intervals; ZQStats now depends on ZQGPU for
      the shared RNG
    - engine: 'bayes [, mcmcsize() burnin() seed() normalprior()]: reg …'
      with reproducible chains; manual entry included
    - validation: with diffuse priors the posterior reproduces OLS (mean
      within 5% of a posterior SD, sd ratio in [0.9, 1.15], CrI brackets the
      estimate, sigma recovers the DGP); tight priors shrink toward zero;
      chains bit-reproducible per seed
    - 111 tests green (swift test and xcodebuild with GPU suites)
    
    Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
    simon-pierre boucher committed 5 days ago (Aug 5, 2026) · 1 file changed +77