A fast linear solver for fixed effects problems
// momentum
// why it's here
- Active: last commit today
- Built almost entirely by one person
- Health 95/100 with only 12 stars
// how to help
// readme
within
within provides high-performance solvers for projecting out high-dimensional fixed effects from regression problems.
By the Frisch-Waugh-Lovell theorem, estimating a regression of the form y = Xฮฒ + Dฮฑ + ฮต reduces to a sequence of least-squares projections, one for y and one for each column of X, followed by a cheap regression fit on the resulting residuals. The projection step of solving the normal equations DโDx = Dโz is the computational bottleneck, which is the problem within is designed to solve.
withinโs solvers are tailored to the structure of fixed effects problems, which can be represented as a graph (as first noted by Correia, 2016). Concretely, within uses modified LSMR with a domain decomposition (Schwarz) preconditioner, backed by approximate Cholesky local solvers (Gao et al, 2025).