Skip to content

Feature/slopes#78

Draft
schroedk wants to merge 20 commits into
mainfrom
feature/slopes
Draft

Feature/slopes#78
schroedk wants to merge 20 commits into
mainfrom
feature/slopes

Conversation

@schroedk

@schroedk schroedk commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

schroedk and others added 20 commits June 28, 2026 16:45
Standalone, on-demand perf comparison for the varying-slopes epic (#64),
timing slope estimation on shared synthetic DGPs before within's slope
solver exists. R fixest is the only live arm; within is a stub behind
--with-within, wired in once #58/#59 land.

- benchmarks/slopes_fixest.py: Case dataclass, fixest/akm slope DGP
  builders (adapted from the defunct prototype, reusing live
  benchmarks._problems panel helpers), DATASETS catalog, run_fixest +
  run_within stub, argparse CLI + table printer.
- benchmarks/fixest_fit.R: R worker (recovered ~verbatim from the lost
  local harness) parameterised over (csv, formula, n_repeat); warmup +
  median-of-n feols, fixef() slope recovery, RESULT_* markers.
- pixi.toml: dedicated fixest feature+env (r-base/r-fixest/r-data.table)
  so R stays out of the default dev/test/CI env; bench-slopes task.

Run: pixi run -e fixest bench-slopes
bench: varying-slopes reference benchmark vs R fixest (#65)
Add an Effect term (levels, intercept, slope covariates) that lowers to
the categories-backed Design; intercept-only effects reproduce the
categories path, slope-bearing ones are rejected (SlopesNotYetSupported)
until a later slice. Generalize solve/solve_batch over a new IntoDesign
trait covering category arrays, Vec<Effect>, and Design.
Intercept-only effects and the equivalent categories matrix run through
the same locality sort, so the result is bit-identical, not just close.
Both solves are asserted converged so the equality cannot pass vacuously.
solve and Solver accept either a categories array or a list of Effect
terms, copied out of Python so the borrowed native Effect can be rebuilt
off-GIL. Route every entry point's preconditioner through
From<PrecondInput> so the resolution lives in one place.
Cross-backend bit-identity vs the categories path, plus the empty-effect,
slope-length, and slope-rejection error surfaces.
feat: varying-slopes effect-term design API + plain-factor parity (#58)
One u32 level column per factor plus f64 loading columns (provisioning
for varying slopes), each independently borrowed or owned via Cow.
Design/Solver trade the storage type parameter for a lifetime; ingest
normalizes any ArrayView2 layout to contiguous columns, and the
gather/scatter kernels read columns directly (scale as Option, hoisted
per chunk).
The negative-column-stride clause guarded ArrayStore's unsafe fast
path; to_slice()-based ingest borrows any stride-1 column zero-copy,
so only a non-unit row stride forces a copy.
…rage

feat: columnar ObservationFrame observation storage (#68)
Varying slopes: design operator applies per-observation loadings + term-major coefficient offsets
…nnel (#69)

UnidentifiedDirection (term, level, column) entries on SolveResult and
BatchSolveResult (shared across RHS), mirrored on the Python result
classes. Always empty until Solver::new accepts slope terms; dropped
slots hold minimal-norm 0, never NaN.
…de-channel

Varying slopes: solve-result side-channel for unidentified directions (#69)
…l reparametrization (#59)

A sole f[z] / f[[z]] term now solves: the slope column is centered against
the pinned intercept (skipped when absent) and weighted-normalized per level,
the solve runs in the whitened basis, and coefficients are mapped back to the
user's parametrization. Rank drops are detected structurally over
positive-weight rows and reported through the unidentified-directions
side-channel with an exact minimal-norm 0 in the coefficient slot.

Slopes alongside other terms (#61) and V>=2 per factor (#60) stay gated.
Varying slopes: single slope on one factor (V=1) — centering + back-transform (#59)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant