Feature/slopes#78
Draft
schroedk wants to merge 20 commits into
Draft
Conversation
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)
…-major offsets (#71)
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.