Learn R Programming

TMB (version 1.9.21)

Template Model Builder: A General Random Effect Tool Inspired by 'ADMB'

Description

With this tool, a user should be able to quickly implement complex random effect models through simple C++ templates. The package combines 'CppAD' (C++ automatic differentiation), 'Eigen' (templated matrix-vector library) and 'CHOLMOD' (sparse matrix routines available from R) to obtain an efficient implementation of the applied Laplace approximation with exact derivatives. Key features are: Automatic sparseness detection, parallelism through 'BLAS' and parallel user templates.

Copy Link

Version

Install

install.packages('TMB')

Monthly Downloads

42,335

Version

1.9.21

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Kasper Kristensen

Last Published

March 23rd, 2026

Functions in TMB (1.9.21)

print.checkConsistency

Print output from checkConsistency
runSymbolicAnalysis

Run symbolic analysis on sparse Hessian
template

Create cpp template to get started.
print.sdreport

Print brief model summary
summary.checkConsistency

Summarize output from checkConsistency
summary.sdreport

summary tables of model parameters
sdreport

General sdreport function.
tmbprofile

Adaptive likelihood profiling.
runExample

Run one of the test examples.
tmbroot

Compute likelihood profile confidence intervals of a TMB object by root-finding
FreeADFun

Free memory allocated on the C++ side by MakeADFun.
MakeADFun

Construct objective functions with derivatives based on a compiled C++ template.
TMB.Version

Version information on API and ABI.
Rinterface

Create minimal R-code corresponding to a cpp template.
GK

Gauss Kronrod configuration
checkConsistency

Check consistency and Laplace accuracy
compile

Compile a C++ template to DLL suitable for MakeADFun.
as.list.sdreport

Convert estimates to original list format.
SR

Sequential reduction configuration
benchmark

Benchmark parallel templates
config

Get or set internal configuration variables
normalize

Normalize process likelihood using the Laplace approximation.
openmp

Control number of OpenMP threads used by a TMB model.
gdbsource

Source R-script through gdb to get backtrace.
confint.tmbprofile

Profile based confidence intervals.
plot.tmbprofile

Plot likelihood profile.
oneStepPredict

Calculate one-step-ahead (OSA) residuals for a latent variable model.
dynlib

Add dynlib extension
newton

Generalized newton optimizer.
precompile

Precompile the TMB library in order to speed up compilation of templates.
newtonOption

Set newton options for a model object.