ctsmTMB: Continuous Time Stochastic Modelling using Template Model Builder

Perform state and parameter inference, and forecasting, in stochastic state-space systems using the 'ctsmTMB' class. This class, built with the 'R6' package, provides a user-friendly interface for defining and handling state-space models. Inference is based on maximum likelihood estimation, with derivatives efficiently computed through automatic differentiation enabled by the 'TMB'/'RTMB' packages (Kristensen et al., 2016) <doi:10.18637/jss.v070.i05>. The available inference methods include Kalman filters, in addition to a Laplace approximation-based smoothing method. For further details of these methods refer to the documentation of the 'CTSMR' package <https://ctsm.info/ctsmr-reference.pdf> and Thygesen (2025) <doi:10.48550/arXiv.2503.21358>. Forecasting capabilities include moment predictions and stochastic path simulations, both implemented in 'C++' using 'Rcpp' (Eddelbuettel et al., 2018) <doi:10.1080/00031305.2017.1375990> for computational efficiency.

Version: 1.0.0
Depends: R (≥ 4.0.0)
Imports: TMB, RTMB (≥ 1.7), R6, Deriv, stringr, Rcpp, RcppEigen, RcppXPtrUtils, RcppZiggurat, Matrix, deSolve, ggplot2, ggfortify, patchwork
LinkingTo: Rcpp, RcppEigen, RcppZiggurat
Suggests: testthat (≥ 3.0.0), knitr, rmarkdown, RTMBode
Published: 2025-04-08
DOI: 10.32614/CRAN.package.ctsmTMB
Author: Phillip Vetter [aut, cre, cph], Jan Møller [ctb], Uffe Thygesen [ctb], Peder Bacher [ctb], Henrik Madsen [ctb]
Maintainer: Phillip Vetter <pbrve at dtu.dk>
BugReports: https://github.com/phillipbvetter/ctsmTMB/issues
License: GPL-3
Copyright: See the file COPYRIGHTS
ctsmTMB copyright details
URL: https://github.com/phillipbvetter/ctsmTMB
NeedsCompilation: yes
SystemRequirements: GNU GSL
Additional_repositories: https://kaskr.r-universe.dev
Citation: ctsmTMB citation info
Materials: README NEWS
CRAN checks: ctsmTMB results

Documentation:

Reference manual: ctsmTMB.pdf
Vignettes: Getting Started (source, R code)
Estimating Parameters (source, R code)
Extended Kalman Filter (source)
Laplace Approximation (source)
Linear Kalman Filter (source)
AddObs - Details (source, R code)
Moment Predictions (source, R code)
Stochastic Simulations (source, R code)
Unscented Kalman Filter (source)
Extracting the Likelihood Function and Changing Optimizer (source, R code)

Downloads:

Package source: ctsmTMB_1.0.0.tar.gz
Windows binaries: r-devel: ctsmTMB_1.0.0.zip, r-release: ctsmTMB_1.0.0.zip, r-oldrel: not available
macOS binaries: r-devel (arm64): ctsmTMB_1.0.0.tgz, r-release (arm64): ctsmTMB_1.0.0.tgz, r-oldrel (arm64): ctsmTMB_1.0.0.tgz, r-devel (x86_64): ctsmTMB_1.0.0.tgz, r-release (x86_64): ctsmTMB_1.0.0.tgz, r-oldrel (x86_64): ctsmTMB_1.0.0.tgz

Linking:

Please use the canonical form https://CRAN.R-project.org/package=ctsmTMB to link to this page.