TMB: Automatic Differentiation and Laplace Approximation
Kasper Kristensen, Anders Nielsen, Casper W. Berg, Hans Skaug, Brad, Bell

TL;DR
TMB is an R package that simplifies the implementation of complex nonlinear random effect models using automatic differentiation and Laplace approximation, offering significant speed improvements for large-scale problems.
Contribution
It introduces an R package that automates the differentiation and Laplace approximation for random effect models, enabling efficient analysis of large datasets.
Findings
Speedups of 1.5 to 100 times over ADMB
Efficient handling of models with ~10^6 random effects
Applicable to large spatial models with Gaussian random fields
Abstract
TMB is an open source R package that enables quick implementation of complex nonlinear random effect (latent variable) models in a manner similar to the established AD Model Builder package (ADMB, admb-project.org). In addition, it offers easy access to parallel computations. The user defines the joint likelihood for the data and the random effects as a C++ template function, while all the other operations are done in R; e.g., reading in the data. The package evaluates and maximizes the Laplace approximation of the marginal likelihood where the random effects are automatically integrated out. This approximation, and its derivatives, are obtained using automatic differentiation (up to order three) of the joint likelihood. The computations are designed to be fast for problems with many random effects (~10^6) and parameters (~10^3). Computation times using ADMB and TMB are compared on a…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDrilling and Well Engineering
