# jags

## Bayesian analyses made easy: GLMMs in R package brms

Here I illustrate how to fit GLMMs with the R package brms, and compare to Jags and lme4.

## Some random piece of code

Gathered some code on occupancy, capture-recapture & epidemiological models, social networks, spatial stuff, textual analyses, reproducible science, etc…

## Jags code to fit a multistate single-season occupancy model

Quick and dirty code to fit a multistate single-season #occupancy model in Jags using a #HMM formulation, in case it's useful https://t.co/vUlrP0jjIU #JAGS #rstats w/ @ArnaudLyet pic.twitter.com/dSr0BlICb6 — Olivier Gimenez 🖖 (@oaggimenez) 13l 2019

## Simulating data with JAGS

Here, I illustrate the possibility to use JAGS to simulate data with two examples that might be of interest to population ecologists: first a linear regression, second a Cormack-Jolly-Seber capture-recapture model to estimate animal survival (formulated as a state-space model). The code is available from [GitHub](https://github.com/oliviergimenez/simul_with_jags).

## Fitting occupancy models in ADMB

Some time ago, a student of mine got stuck when fitting dynamic occupancy models to real data in Jags because of the computational burden.