Package: fastsae 1.0.0

fastsae: High-Performance Frequentist and Bayesian Small Area Estimation in R

High-performance Small Area Estimation (SAE) in R, implementing frequentist EBLUP models via compiled C++ and Bayesian hierarchical models via 'INLA' (Integrated Nested Laplace Approximations) or, optionally, full MCMC with 'NumPyro' (Phan et al., 2019) <doi:10.48550/arXiv.1912.11554> on 'JAX' (CPU or NVIDIA GPU). Frequentist models include the area-level Fay-Herriot model (Fay and Herriot, 1979 <doi:10.1080/01621459.1979.10482505>), spatial Fay-Herriot (Pratesi and Salvati, 2008 <doi:10.1007/s10260-007-0061-9>), spatio-temporal Fay-Herriot (Marhuenda et al., 2013 <doi:10.1016/j.csda.2012.09.002>), unit-level Battese-Harter-Fuller (Battese et al., 1988 <doi:10.1080/01621459.1988.10478561>), and two-fold subarea models (Torabi and Rao, 2014 <doi:10.1016/j.jmva.2014.02.001>) for nested area-subarea hierarchies. Bayesian models use 'INLA' (Rue et al., 2009 <doi:10.1111/j.1467-9868.2008.00700.x>), supporting 6 likelihood families (Gaussian, Beta, Binomial, Poisson, Negative Binomial, Gamma), spatial structures (BYM2, Besag ICAR), temporal dynamics (RW1, RW2, AR1), and spatio-temporal interactions. Key features include analytical and bootstrap MSE estimation, benchmarking to aggregate targets (Rao and Molina, 2015 <doi:10.1002/9781118735855>), automatic handling of unsampled domains, and S3 methods for summaries, diagnostics and plots.

Authors:Ridson Al Farizal P [aut, cre, cph], Azka Ubaidillah [aut]

fastsae_1.0.0.tar.gz
fastsae_1.0.0.zip(r-4.7-x86_64)fastsae_1.0.0.zip(r-4.7-arm64)fastsae_1.0.0.zip(r-4.6-x86_64)fastsae_1.0.0.zip(r-4.6-arm64)fastsae_1.0.0.zip(r-4.5-x86_64)
fastsae_1.0.0.tgz(r-4.6-x86_64)fastsae_1.0.0.tgz(r-4.6-arm64)fastsae_1.0.0.tgz(r-4.5-x86_64)fastsae_1.0.0.tgz(r-4.5-arm64)
fastsae_1.0.0.tar.gz(r-4.7-arm64)fastsae_1.0.0.tar.gz(r-4.7-x86_64)fastsae_1.0.0.tar.gz(r-4.6-arm64)fastsae_1.0.0.tar.gz(r-4.6-x86_64)
fastsae_1.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
fastsae/json (API)

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

Bug tracker:https://github.com/ridsonap/fastsae/issues

Pkgdown/docs site:https://ridsonap.github.io

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • cornsoybean - Corn and Soybean Survey and Satellite Data in 12 Iowa Counties
  • cornsoybeanmeans - Corn and Soybean Mean Number of Pixels per Segment for 12 Iowa Counties
  • mys - Mys: mean years of schooling people with disabilities.
  • mys_panel - Mys_panel: mean years of schooling people with disabilities 2016 - 2026.
  • mys_proxmat - Example proximity matrix
  • sim_area - Multi-Distribution Synthetic Area-Level Dataset
  • sim_panel - Multi-Distribution Spatio-Temporal Panel Dataset

On CRAN:

Conda:

cppinlaopenmpsmall-area-estimationopenblascpp

5.32 score 1 stars 309 downloads 25 exports 22 dependencies

Last updated from:7e20210fc3. Checks:4 ERROR, 11 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64ERROR326
linux-devel-x86_64OK592
source / vignettesOK637
linux-release-arm64ERROR403
linux-release-x86_64OK639
macos-release-arm64OK948
macos-release-x86_64OK1566
macos-oldrel-arm64ERROR320
macos-oldrel-x86_64ERROR759
windows-devel-arm64OK498
windows-devel-x86_64OK684
windows-release-arm64OK446
windows-release-x86_64OK505
windows-oldrel-x86_64OK891
wasm-releaseOK362

Exports:add_reliability_flagsautoplotbenchmark_saecheck_numpyro_availablecompare_saecreate_weightsdiagnoseeblup_bhfeblup_fheblup_sfheblup_stfheblup_twofoldexport_saegvf_smoothhb_areahb_twofoldhb_unitinla_enginejax_enginemap_saesetup_numpyro_envsim_area_datasim_series_datasim_spatial_weightsspatial_test

Dependencies:clicpp11farverggplot2gluegtableisobandlabelinglatticelifecycleMatrixR6RColorBrewerRcppRcppArmadilloRcppEigenrlangS7scalesvctrsviridisLitewithr

Spatial and Spatio-Temporal Models
Overview | 1. Spatial Fay-Herriot Model (eblup_sfh) | Model Formulation | Fitting the Model | Unsampled Domains and Spatial Kriging | Multi-Threaded Bootstrap MSE | 2. Spatio-Temporal Fay-Herriot Model (eblup_stfh) | Fitting the Spatio-Temporal Model | Unsampled Domains and Missing Periods | 3. Comparing Models with autoplot | 4. Bayesian Spatio-Temporal Modeling (hb_area) | References

Last update: 2026-10-14
Started: 2026-09-21

Model Diagnostics and Residual Analysis
Introduction | Core Diagnostic Criteria | Practical Example: Diagnosing a Fay-Herriot Model | 1. Fit Model and Run diagnose() | 2. Inspect Diagnostic Components | Visual Diagnostics with autoplot() | 1. Calibration Plot (type = "calibration") | 2. Precision Comparison (type = "rse") | 3. Residual Diagnostics (type = "residuals" & type = "qq") | 4. Combined Diagnostic Dashboard (type = "all") | Diagnosing Bayesian Spatio-Temporal Models | References

Last update: 2026-10-13
Started: 2026-09-26

Bayesian Area-Level Small Area Estimation with INLA
Introduction | Supported Distribution Families | Mathematical Formulation | Level 1: Sampling Model (Likelihood) | Level 2: Prior on Fixed Effects | Level 3: Prior on Random Effects | INLA Approximation | Spatial and Spatio-Temporal Structures | Spatial Priors | Temporal Models | Space-Time Interaction Structures (st_interaction) | Case Study: Spatio-Temporal Beta SAE on Emilia-Romagna Poverty | 1. Load Data and Construct Spatial Adjacency Matrix | 2. Fit Spatio-Temporal Beta Model | 3. Inspect Posterior Predictions and Uncertainty | Comparison and Validation Against tipsae (Stan MCMC) | Interactive Scalability Explorer ($n = 30$ to $n = 1,000$) | Inferential Equivalence & Validation Metrics ($n = 1,000$) | Cross-Sectional Count Data: Poisson & Negative Binomial | References

Last update: 2026-10-13
Started: 2026-09-29

Performance & Scalability Benchmarks
Executive Summary | Benchmark Results Table | Interactive Benchmark Explorer | Architectural Insights: Why is fastsae so Fast? | Bayesian Spatio-Temporal Benchmark: fastsae (INLA) vs tipsae (Stan MCMC) | Interactive Beta SAE Benchmark Explorer ($n = 30$ to $n = 1,000$) | Inferential Equivalence & Validation Metrics ($n = 1,000$) | Finite Population Simulation & Ground Truth Validation

Last update: 2026-10-13
Started: 2026-09-21

Finite Population Simulation: Validating fastsae against Ground Truth
Introduction: Why Finite Population Simulation? | Simulation Architecture | Mathematical Formulations of Empirical Properties | Empirical Benchmark Results ($R = 100$ Replications, $D = 60$) | Key Empirical Findings: | National-Scale Benchmark ($D = 500$ Domains, $N \approx 250{,}000$ Individuals, $R = 25$) | Key National Scalability Takeaways: | Visualizations | 1. Domain-Specific Empirical RMSE | 2. Empirical 95% Credible Interval Coverage | How to Replicate | References

Last update: 2026-10-13
Started: 2026-09-27

Getting Started with fastsae
Introduction | The Fay-Herriot Model | Step-by-Step Example | 1. Load Package and Dataset | 2. Fit Fay-Herriot Model (eblup_fh) | 3. Model Summary and Coefficients | 4. Diagnostic Plots (autoplot) | Direct Estimates vs EBLUP | Mean Squared Error (MSE) Across Domains | Exact Numerical Equivalence with sae | Next Steps | References

Last update: 2026-09-29
Started: 2026-09-21

Unit-Level Estimation with Battese-Harter-Fuller
Overview | Model Formulation | Step-by-Step Example | 1. Data Preparation | 2. Fit BHF Model with Bootstrap MSE | 3. Inspect Domain Estimates | 4. Visualizing Results with autoplot | References

Last update: 2026-09-21
Started: 2026-09-21

Readme and manuals

Help Manual

Help pageTopics
Add Official Statistical Reliability Flagsadd_reliability_flags
Autoplot Method for fastsae Objectsautoplot.fastsae autoplot.list
Autoplot Method for fastsae_diagnose Objectsautoplot.fastsae_diagnose
Benchmark Small Area Estimation Predictions to Aggregate Targetsautoplot.fastsae_benchmark benchmark_sae benchmark_sae.default benchmark_sae.fastsae plot.fastsae_benchmark print.fastsae_benchmark summary.fastsae_benchmark
Check whether the NumPyro / JAX engine is availablecheck_numpyro_available
Extract coefficients from a fastsae objectcoef.fastsae
Compare Two Small Area Estimation Modelsautoplot.fastsae_comparison compare_sae compare_sae.default plot.fastsae_comparison print.fastsae_comparison summary.fastsae_comparison
Corn and Soybean Survey and Satellite Data in 12 Iowa Countiescornsoybean
Corn and Soybean Mean Number of Pixels per Segment for 12 Iowa Countiescornsoybeanmeans
Create Spatial Proximity and Weights Matrixcreate_weights
Diagnostic Evaluation of Small Area Estimation Modelsdiagnose
Empirical Best Linear Unbiased Prediction (EBLUP) for the Battese-Harter-Fuller Modeleblup_bhf
Empirical Best Linear Unbiased Prediction based on a Fay-Herriot Model.eblup_fh
Empirical Best Linear Unbiased Prediction based on a Spatial Fay-Herriot Model.eblup_sfh
Empirical Best Linear Unbiased Prediction based on a Spatio-Temporal Fay-Herriot Model.eblup_stfh
Empirical Best Linear Unbiased Prediction under a Two-fold Fay-Herriot Model.eblup_twofold
Export Small Area Estimation Results to Excel or CSVexport_sae
Extract fitted values (EBLUP or HB) from a fastsae objectfitted.fastsae
Generalized Variance Function (GVF) Smoothing for Sampling Variancesgvf_smooth
Hierarchical Bayes for Area-Level Small Area Estimationhb_area
Estimation engines for the Hierarchical Bayes modelshb_engine inla_engine jax_engine print.fastsae_engine
Two-Fold Hierarchical Bayes for Sub-Area Level Small Area Estimationhb_twofold
Hierarchical Bayes for Unit-Level Small Area Estimationhb_unit
Unified Spatial Choropleth Mapping for Small Area Estimatesmap_sae map_sae.default map_sae.fastsae map_sae.fastsae_benchmark map_sae.list
mys: mean years of schooling people with disabilities.mys
mys_panel: mean years of schooling people with disabilities 2016 - 2026.mys_panel
Example proximity matrixmys_proxmat
Plot method for fastsae objectsplot.fastsae
Print a fastsae objectprint.fastsae
Print summary of a fastsae objectprint.summary.fastsae
Extract residuals from a fastsae objectresiduals.fastsae
Set up the Python environment for the NumPyro / JAX enginesetup_numpyro_env
Multi-Distribution Synthetic Area-Level Datasetsae_area_multi sim_area
Simulate Multi-Distribution Small Area Data with Spatial Autocorrelationsim_area_data
Multi-Distribution Spatio-Temporal Panel Datasetsae_panel_multi sim_panel
Simulate Spatio-Temporal Multi-Distribution Small Area Datasim_series_data
Simulate Spatial Proximity and Adjacency Matricessim_spatial_weights
Pre-Modeling Spatial Diagnostic and Autocorrelation Testsspatial_test
Summarize a fastsae objectsummary.fastsae