English

A Statistical Introduction to Template Model Builder: A Flexible Tool for Spatial Modeling

Methodology 2021-03-19 v1 Computation

Abstract

The integrated nested Laplace approximation (INLA) is a well-known and popular technique for spatial modeling with a user-friendly interface in the R-INLA package. Unfortunately, only a certain class of latent Gaussian models are amenable to fitting with INLA. In this paper we describe Template Model Builder (TMB), an existing technique which is well-suited to fitting complex spatio-temporal models. TMB is relatively unknown to the spatial statistics community, but is a highly flexible random effects modeling tool which allows users to define complex random effects models through simple C++ templates. After contrasting the methodology behind TMB with INLA, we provide a large-scale simulation study assessing and comparing R-INLA and TMB for continuous spatial models, fitted via the Stochastic Partial Differential Equations (SPDE) approximation. The results show that the predictive fields from both methods are comparable in most situations even though TMB estimates for fixed or random effects may have slightly larger bias than R-INLA. We also present a smaller discrete spatial simulation study, in which both approaches perform well. We conclude with an analysis of breast cancer incidence and mortality data using a joint model which cannot be fit with INLA.

Keywords

Cite

@article{arxiv.2103.09929,
  title  = {A Statistical Introduction to Template Model Builder: A Flexible Tool for Spatial Modeling},
  author = {Aaron Osgood-Zimmerman and Jon Wakefield},
  journal= {arXiv preprint arXiv:2103.09929},
  year   = {2021}
}

Comments

84 pages, 30 figures

R2 v1 2026-06-24T00:17:36.905Z