# HDFE Poisson Baseline (Phase 0)

> See [`SUMMARY.md`](SUMMARY.md) for the full Phase 0–8 roadmap and per-phase
> verification reports.

Cross-backend baseline for `fepois` on synthetic two-way HDFE Poisson data. Generated by `benchmarks/hdfe/run_baseline.py`. Numbers here freeze the **starting line** that StatsPAI's Rust HDFE backend (Phase 1+) must beat.

_Generated_: 2026-04-27 02:39:23 PDT

## Datasets

| name | n | fe1 cardinality | fe2 cardinality | y mean | y zero share | seed |
|---|---:|---:|---:|---:|---:|---:|
| small | 100,000 | 1,000 | 50 | 1.956 | 0.247 | 42 |
| medium | 1,000,000 | 100,000 | 1,000 | 2.112 | 0.227 | 43 |

## Wall-clock (mean of timed runs)

| dataset | statspai | pyfixest | fixest | ppmlhdfe |
|---|---:|---:|---:|---:|
| small | 64ms | 94ms | 67ms | — |
| medium | 1.69s | 2.01s | 644ms | — |

## Peak RSS (Python subprocesses; sampled)

| dataset | statspai | pyfixest |
|---|---:|---:|
| small | 556MB | 511MB |
| medium | 1519MB | 1538MB |

## Coefficient cross-backend diff (vs `fixest` if present, else `pyfixest`)

Reports `max_abs_diff` of (β_x1, β_x2) against the reference backend.
Acceptance threshold (Phase 0 sign-off): **≤ 1e-6** wherever fixest is the reference.

| dataset | reference | backend | β_x1 | β_x2 | max_abs_diff |
|---|---|---|---:|---:|---:|
| small | fixest | fixest | 0.30020902 | -0.20020091 | 0 |
| small | fixest | statspai | 0.30020902 | -0.20020091 | 7.73e-13 |
| small | fixest | pyfixest | 0.30020902 | -0.20020091 | 7.73e-13 |
| medium | fixest | fixest | 0.29850086 | -0.19937659 | 0 |
| medium | fixest | statspai | 0.29850086 | -0.19937659 | 6.57e-14 |
| medium | fixest | pyfixest | 0.29850086 | -0.19937659 | 6.57e-14 |

## Environment

Captured at run time so future regressions know what they're compared against:

- **python**: 3.13.2
- **platform**: darwin
- **numpy**: 2.2.2
- **pandas**: 2.2.3
- **pyfixest**: 0.50.1
- **statspai**: 1.7.1
- **R**: 4.5.2
- **R fixest**: 0.14.0

