Fitting dynamic occupancy models with TMB

Following my recent attempt to [fit a HMM model to capture-recapture data with TMB](https://oliviergimenez.github.io/post/multievent_in_tmb/) and the rather estonishing outcome (the code was > 300 time faster than the equivalent R code!), I was curious to add TMB to the [list of options I tried to fit dynamic occupancy models](https://oliviergimenez.github.io/post/occupancy_in_admb/). Well, the least I can say is that TMB is fast, damn fast!

The reasons for trying TMB were the same as before: TMB is said to be fast, allows for parallel computations, works with R, accomodates spatial stuff, allows easy implementation of random effects).

I found materials on the internet to teach myself TMB, at least what I needed to implement a simple HMM model. See here for a linear regression and a Gompertz state space model examples, here for the same linear regression example on Youtube (that’s awesome!) and many other examples here.

The R code is available on my GitHub here. TMB was… wait for it… > 300 times faster than ADMB, > 140 times than Unmarked and > 6000 times faster than Jags (although the comparison with the latter is a bit unfair I suppose). The results are available here.

I’m new to TMB, but I’m gonna definitely dig into it. Congrats to the developers! Check out the TMB website as well as the paper that comes with it.

Statistics, ecology & social sciences

I’m a scientist working at the interface of animal ecology, statistical modeling and social sciences.

comments powered by Disqus

Related