TMBad vs cppAD documentation?

44 views
Skip to first unread message

Ben Bolker

unread,
Jun 2, 2025, 1:35:56 PMJun 2
to tmb-...@googlegroups.com
Hi all,

I'm starting to work with someone who is comfortable with CppAD. I'd
like to be able to have an informed conversation with them about the
pros and cons of TMBad vs CppAD. What I know is:

* CppAD is more mature (+ wider user base, maybe? wider developer base,
although I'm not sure -- maybe just Brad Bell
<https://github.com/coin-or/CppAD/blob/master/authors> ?)

* TMBad is newer, handles parallelization more automatically. What are
the other advantages? Better sparsity-handling? From ?compile, "For
example ‘framework='TMBad'’ allows one to calculate the Hessian of the
Laplace approximation"

There are two hits on Google Scholar for "TMBad kristensen" or "TMBad
CppAD", one of which is a master's thesis I supervised (so I know there
isn't any more information there!) -- the other is

Oketch, Godrick, Rachel M. Fewster, and Jesse Goodman. 2025. “What Is
the Price of Approximation? The Saddlepoint Approximation to a
Likelihood Function.” arXiv. https://doi.org/10.48550/arXiv.2504.07324.

who suggest that they use both TMBad and CppAD, but I haven't dug
into the supplemental materials yet to see how they use them ...

cheers
Ben Bolker




Kelli Johnson - NOAA Federal

unread,
Jun 2, 2025, 1:56:23 PMJun 2
to TMB Users
I thought that CppAD development made it hard for Kasper to keep up with, leading to downstream breaking of TMB each time CppAD was updated. Thus, TMB does not use the most recent version of CppAD and instead it is hard linked to an old version.
Best,
Kelli

Kasper Kristensen

unread,
Jun 4, 2025, 4:31:58 AMJun 4
to TMB Users
Ben, I thought this was already partially answered in https://github.com/kaskr/adcomp/issues/374 (asked by you)?

To highlight a few differences:

TMBad pros:

- Typically faster and more memory efficient for TMB models using the Laplace approximation. (This claim is based on the TMB example suite)
- Memory management suitable for interactive use i.e. RTMB.

CppAD pros:

- Established library that can by used independent of TMB.
- Has more algorithms implemented: sparsity using coloring, reverse and forward mode implemented for *all* operators etc.

Ben Bolker

unread,
Jun 4, 2025, 9:57:31 AMJun 4
to tmb-...@googlegroups.com
Thanks, Kasper. All my "TMBad vs CppAD" searching had failed to find
this, it's very complete ...

cheers
Ben
> <https://github.com/coin-or/CppAD/blob/master/authors <https://
> github.com/coin-or/CppAD/blob/master/authors>> ?)
>
> * TMBad is newer, handles parallelization more automatically.
> What are
> the other advantages? Better sparsity-handling? From ?compile, "For
> example ‘framework='TMBad'’ allows one to calculate the Hessian
> of the
> Laplace approximation"
>
> There are two hits on Google Scholar for "TMBad kristensen" or
> "TMBad
> CppAD", one of which is a master's thesis I supervised (so I
> know there
> isn't any more information there!) -- the other is
>
> Oketch, Godrick, Rachel M. Fewster, and Jesse Goodman. 2025.
> “What Is
> the Price of Approximation? The Saddlepoint Approximation to a
> Likelihood Function.” arXiv. https://doi.org/10.48550/
> arXiv.2504.07324 <https://doi.org/10.48550/arXiv.2504.07324>.
>
> who suggest that they use both TMBad and CppAD, but I haven't dug
> into the supplemental materials yet to see how they use them ...
>
> cheers
> Ben Bolker
>
>
>
>
> --
> To post to this group, send email to us...@tmb-project.org. Before
> posting, please check the wiki and issuetracker at https://github.com/
> kaskr/adcomp/ <https://github.com/kaskr/adcomp/>. Please try to create a
> simple repeatable example to go with your question (e.g issues 154, 134,
> 51). Use the issuetracker to report bugs.
> ---
> You received this message because you are subscribed to the Google
> Groups "TMB Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to tmb-users+...@googlegroups.com <mailto:tmb-
> users+un...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/tmb-
> users/96e8563f-5432-4c8d-8eb2-b4af08a2c2b6n%40googlegroups.com <https://
> groups.google.com/d/msgid/tmb-users/96e8563f-5432-4c8d-8eb2-
> b4af08a2c2b6n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
> E-mail is sent at my convenience; I don't expect replies outside of
working hours.

Reply all
Reply to author
Forward
0 new messages