| Title: | High-Performance Fixed Effects Solver |
|---|---|
| Description: | Fast modified LSMR solvers with Schwarz and diagonal preconditioners for absorbing high-dimensional fixed effects in panel data regressions. The computational core is written in Rust via version 0.2.0 of the 'within' crate and accessed through 'extendr'. |
| Authors: | Alexander Fischer [aut, cre], Kristof Schroeder [aut] |
| Maintainer: | Alexander Fischer <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-06 13:48:32 UTC |
| Source: | https://github.com/py-econometrics/within |
Additive Schwarz preconditioner configuration
AdditiveSchwarz(local_solver = NULL, reduction = ReductionStrategy$Auto)AdditiveSchwarz(local_solver = NULL, reduction = ReductionStrategy$Auto)
local_solver |
|
reduction |
One of |
A preconditioner configuration object.
Approximate Cholesky configuration
ApproxCholConfig(seed = 0, split_merge = NULL)ApproxCholConfig(seed = 0, split_merge = NULL)
seed |
Non-negative integer random seed. |
split_merge |
Optional positive integer split/merge parameter, or |
A local-solver configuration object.
Approximate Schur complement configuration
ApproxSchurConfig(seed = 0, split = 1L)ApproxSchurConfig(seed = 0, split = 1L)
seed |
Non-negative integer random seed. |
split |
Positive integer edge split factor. |
A local-solver configuration object.
Local solver configuration for additive Schwarz subdomains
LocalSolverConfig( approx_chol = NULL, approx_schur = .default_approx_schur(), dense_threshold = NULL )LocalSolverConfig( approx_chol = NULL, approx_schur = .default_approx_schur(), dense_threshold = NULL )
approx_chol |
|
approx_schur |
Omitted for the library default approximate Schur,
|
dense_threshold |
Optional non-negative integer dense Schur threshold. |
A local-solver configuration object accepted by AdditiveSchwarz().
Uses Modified Golub-Kahan bidiagonalization to solve the least-squares
problem directly. The preconditioner approximates A^T A and is applied as
one M^{-1} solve per iteration.
LsmrOptions(tol = 1e-08, maxiter = 1000L, local_size = NULL) lsmr_options(tol = 1e-08, maxiter = 1000L, local_size = NULL)LsmrOptions(tol = 1e-08, maxiter = 1000L, local_size = NULL) lsmr_options(tol = 1e-08, maxiter = 1000L, local_size = NULL)
tol |
Positive finite convergence tolerance. Default |
maxiter |
Maximum number of LSMR iterations. Default |
local_size |
Optional window size for modified Gram-Schmidt
reorthogonalization, or |
A solver options object accepted by solve(), solve_batch(), and
persistent solver methods.
Deserializes a preconditioner from raw bytes produced by
solver$preconditioner()$serialize(). Handles returned by
solver$preconditioner() also expose $variant and $build_time_seconds
metadata. Deserialized handles keep $variant but report
$build_time_seconds = NA_real_.
Preconditioner(data)Preconditioner(data)
data |
Raw vector containing serialized preconditioner bytes. |
A within_preconditioner object with $apply() and $serialize()
methods, $nrows, $ncols, $variant, and $build_time_seconds fields.
Use PreconditionerConfig$Additive, PreconditionerConfig$Off, or
PreconditionerConfig$Diagonal as the preconditioner argument.
Additive builds the default additive Schwarz preconditioner, Off
disables preconditioning, and Diagonal uses diagonal/Jacobi scaling.
PreconditionerConfigPreconditionerConfig
An object of class within_preconditioner_config of length 3.
Use these values inside AdditiveSchwarz().
ReductionStrategyReductionStrategy
An object of class within_reduction_strategy of length 3.
Computes fixed-effect coefficients by solving the normal equations
where is the dummy-variable design
matrix implied by categories and is the diagonal weight matrix.
solve(categories, y, options = NULL, weights = NULL, preconditioner = NULL)solve(categories, y, options = NULL, weights = NULL, preconditioner = NULL)
categories |
Integer matrix of shape |
y |
Numeric vector of length |
options |
|
weights |
Numeric vector of length |
preconditioner |
Controls preconditioning. Five input forms are
accepted: |
A named list with fields x, demeaned, converged,
iterations, residual, time_total, time_setup, and time_solve.
Builds the operator and preconditioner once, then solves for each column
of Y in parallel.
solve_batch( categories, Y, options = NULL, weights = NULL, preconditioner = NULL )solve_batch( categories, Y, options = NULL, weights = NULL, preconditioner = NULL )
categories |
Integer matrix of shape |
Y |
Numeric matrix of shape |
options |
|
weights |
Numeric vector of length |
preconditioner |
Controls preconditioning. Five input forms are
accepted: |
A named list with matrix fields x and demeaned, plus
converged, iterations, residual, time_solve, and time_total.
Builds the preconditioner once and reuses it for repeated solves with the same design matrix.
Solver(categories, weights = NULL, preconditioner = NULL)Solver(categories, weights = NULL, preconditioner = NULL)
categories |
Integer matrix of shape |
weights |
Numeric vector of length |
preconditioner |
Controls preconditioning. Five input forms are
accepted: |
A within_solver object with $solve(), $solve_batch(), and
$preconditioner() methods, plus $n_dofs and $n_obs fields.