Package: RASbound 0.0.1

Jose M. Pavía

RASbound: Bounded RAS / Biproportional Matrix Balancing with Cell-Level Constraints

Implements the RAS method for adjusting a matrix to match target row and column totals. In RAS, a matrix A is multiplied on the left by a diagonal matrix R and on the right by a diagonal matrix S, which gives the method its name. It is also known as biproportional matrix balancing, iterative proportional fitting (IPF) or raking. The package extends it with lower and upper bounds on individual cells. Provides several algorithmic variants for handling bound violations: hard cell-freezing with simultaneous, sequential, or hybrid fixation; two dependency-free clamp-and-compensate heuristics (proportional redistribution and iterative renormalization); and a naive unconstrained-recompute baseline; together with thin wrapper functions exposing equivalent bounded-calibration methods from the 'survey' package under a common interface. Intended for updating or regionalizing input-output tables, social accounting matrices (SAMs), and other applications where classic RAS/IPF is used but cell-level plausibility ranges must be respected. References: Deming and Stephan (1940) <doi:10.1214/aoms/1177731829> Deville, Saerndal and Sautory (1993) <doi:10.1080/01621459.1993.10476369> Acknowledgements: The author wishes to thank Conselleria de Educacion, Cultura y Universidades, Generalitat Valenciana (grant CIAICO/2023/031) for supporting this research.

Authors:Jose M. Pavía [aut, cre]

RASbound_0.0.1.tar.gz
RASbound_0.0.1.zip(r-4.7-any)RASbound_0.0.1.zip(r-4.6-any)
RASbound_0.0.1.tar.gz(r-4.7-any)RASbound_0.0.1.tar.gz(r-4.6-any)
RASbound_0.0.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
RASbound/json (API)

# Install 'RASbound' in R:
install.packages('RASbound', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/jmpavia/rasbound/issues

On CRAN:

Conda:

3.18 score 10 exports 0 dependencies

Last updated from:6704da3c9f. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK120
source / vignettesOK363
linux-releaseOK99
windows-develOK73
windows-releaseOK63
wasm-releaseOK83

Exports:bras_calibrate_linearbras_calibrate_logitbras_calibrate_rakingbras_cap_iterbras_freeze_hybridbras_freeze_seqbras_freeze_simbras_naivebras_softras

Dependencies:

A worked example: a 57 x 57 input-output-style table
Hard-freeze variants | Where the bounds bind | The survey wrappers on the same problem

Last update: 2026-10-28
Started: 2026-10-28

Advanced diagnostics
A running example | Reading fixed_cells | Diagnosing infeasibility | feasible = TRUE but converged = FALSE | Cells that must be exactly zero | Comparing variants on the same problem | bras_calibrate_linear() and bras_calibrate_raking() give different matrices | When bras_calibrate_logit() fails | When bras_freeze_hybrid()'s per-pass fallback is not enough | A stall: no violated bound, but the margins do not match | A real infeasible case: a stall with no solution behind it

Last update: 2026-10-28
Started: 2026-10-28

Introduction to RASbound
The problem | A minimal example | Which function should I use? | The hard-freeze family | The reference variants | The survey wrappers | Where to go next

Last update: 2026-10-28
Started: 2026-10-28