Kasper Kristensen edited this page Jun 28, 2017 · 14 revisions

Welcome to the TMB Wiki

TMB (Template Model Builder) is an R package for fitting statistical latent variable models to data. It is strongly inspired by ADMB. Unlike most other R packages the model is formulated in C++. This provides great flexibility, but requires some familiarity with the C/C++ programming language.

  • TMB can calculate first and second order derivatives of the likelihood function by AD, or any objective function written in C++.
  • The objective function (and its derivatives) can be called from R. Hence, parameter estimation via e.g. nlminb() is easy.
  • The user can specify that the Laplace approximation should be applied to any subset of the function arguments.
    • Yields marginal likelihood in latent variable model.
  • Standard deviations of any parameter, or derived parameter, obtained by the 'delta method'.
  • Pre and post-processing of data done in R.
  • TMB is based on state-of-the art software: CppAD, Eigen, ...
  • A beginner's template listing some common functions and specifications can be seen at template.cpp
  • The "Application Programmers Interface" of TMB is at function reference

Links to other wikipages

Links to related tools

  • Python Model Builder PyMB