Intro

In this dedicated site you can find the contents for the workshop Introduction to Bayesian Inference in Ecology. It will be held at the III meeting of the Iberian Ecological Society (SIBECOL) / XVII National Conference of the Spanish Association of Terrestrial Ecology (AEET) in June 2025. Check the following links for the workshop materials:

  • Slides with theoretical contents (see Syllabus below).
  • Scripts and data sets for the practical sessions (see Syllabus below).
  • Cheatsheet about probability distributions and link functions.

This is a reduced version of the IBER (Inferencia Bayesiana para Ecólogos en R) workshop, from Valentin Lauret and Javier Fernández-López. Many of the materials and ideas have been sourced from Olivier Gimenez (thanks Olivier!).

General info

What: This is an introductory workshop on Bayesian Inference. The basic concepts of probability and generalized linear models will be explained, in order to later fit such models using Bayesian Inference in R and NIMBLE. Finally, there will be a brief discussion of more complex models in ecology and how Bayesian Inference can help us fit them.

For whom: This is a workshop for ecologists in a broad sense. A laptop with R, RStudio, and Nimble installed is required (see below); basic knowledge of R and GLMs is also recommended.

By: Sonia Illanas (IREC, CSIC-UCLM-JCCM) & Javier Fernández-López (IREC, CSIC-UCLM-JCCM))

When: Monday, June 2, 10:00-14:00

Where: Palacio de Congresos de Pontevedra (Pazo da Cultura de Pontevedra), Spain, Room: Seminario 3

Syllabus

  1. Intro and probability distributions
  2. Some GLM’s basics
  3. Bayesian Inference: a bit of theory
  4. Fitting a GLM in NIMBLE
  5. A look at more complex models

You can find all the materials here: slides and a full script with the code we will use.

Requirements

  • You need to install R (and RStudio for convenience).

  • You also need to install Nimble by following these guidelines. Note that Windows users might need to install RTools if it hasn’t been installed already. Once everything is installed, run the following code in R. If it runs without errors, everything is set up correctly. Otherwise, get in touch with us!

library(nimble)
  code <- nimbleCode({
  y ~ dnorm(0,1)
  })
  model <- nimbleModel(code)
  cModel <- compileNimble(model)
  • Install the R packages: tidyverse, mcmcplots, coda. To do that, you can run the following code:
install.packages(c("tidyverse", "mcmcplots", "coda"))