UKCEH-BioSS framework delivery workshop 2023

Welcome

This is the course website for the 2 day workshop delivered as part of the UKCEH-BioSS framework agreement. Some background was covered at this workshop.

The instructors for the course will be:

Schedule

Timings are indicative and we may bring components forward or backward according to participants needs (including ours).

Day 1

  • Morning (09:30 - 12:00)
    • Optional self-directed refresher on GAMs (see guidance below)
    • Staff will be on call from 11:00 to 12:00 if you would like clarification about some of the pre-requisites (optional, send an email to thomas.cornulier@bioss.ac.uk if you would like to ask a question, and we’ll see you online shortly)
  • Afternoon (13:00 - 17:00)
    • Foreword: Thomas Cornulier / Pete Henrys
    • Project 1: data fusion with change of support
      • package, simulation, sampling (1hr Ana) PDF slides PowerPoint slides
      • break (15 min)
      • Data fusion modelling (1hr Fergus) HTML slides
      • break (15 min)
      • practical and vignette (1hr Ana and Fergus) (see vignette links at top of page)
      • discussion (30 mins)

Day 2

  • Morning (09:30 - 12:30)
    • Project 2: estimating effect size variation across a zone of influence
      • Introduction to the background and theory (1 hr Dave) HTML slides
      • break (15 min)
      • Application (10 min Thomas)
      • Practical (30 min)
      • Extensions (20 min Thomas)
      • Practical (1 hr)
  • Afternoon (13:30 - 17:00)
    • Extended practical session, with one to one support available (2.5 hr, pick and mix across the two projects)
    • Q&A with discussion of further applications (1 hr)

Pre-requisites

Theory

  • Basic understanding of GAM theory
    • 1D splines & spline bases
    • (notion of penalization)
    • 2D splines
      • isotropic
      • anisotropic
  • Basic GAMs practice with mgcv in R
    • fitting the model
    • interpreting the output
    • making predictions
    • model validation

See the resources section below, for useful materials.

Computing

We recommend updating to the latest version of R from r-project.org, then running:

update.packages("mgcv")

to ensure that you have the latest version of mgcv.

Exercises use a variety of R packages, the following should install the necessary packages:

install.packages(c("tidyverse", "patchwork", "gratia"))

For the project 1 practicals you’ll need the package ascot written by Ana, Fergus and Jackie. You can install this using the remotes package:

# if you don't have remotes installed
install.packages("remotes")

# install ascot
remotes::install_git("https://gitlab.bioss.ac.uk/ukceh-bioss-framework/outputs/ascot.git")

Or download the package and install manually (as a source package).

Data

The kittiwake data for use with the vignettes in project 2.

Running the Shiny app

Ana will talk through a Shiny app she’s written that is included as part of ascot. You can run this on your own computer, once ascot is installed using

shiny::runApp(system.file(package="ascot", file="ASCOT_Shiny.R"))

(This should pop-up a web browser with the app running.)

Self-directed GAM learning

Background knowledge assumption increases as you move down the list. Resources 1 and 2 cover all the key concepts you should need, in a condensed way (2D smoothing is only covered in resource 1). The rest is provided for reference.

Resources 3 and 4 are great and more comprehensive but require greater time investment (useful for browsing specific parts, or to come back to, as needed).

  1. Materials from our previous intro GAM workshop
  2. A condensed shortcut to 1D GAM theory with self-supporting text, in journal paper format: Gavin Simpson’s paper “Modelling palaeoecological time series using generalised additive models”.
  3. (3.5 h) GAM intro youtube video by Gavin Simpson
  4. (long) Online course on GAMs by Noam Ross
  5. Dave and co’s paper on modelling hierarchical effects using GAMs also has some potentially useful background information on GAMs. A useful reference if you would like you a headstart on material covered in the first afternoon, or for later reference / more technical detail.
  6. Dave’s preprint on Bayesian views of GAMs.

Further reading on GAMs

Things that came up during the course

This work is licensed under Attribution-NonCommercial-ShareAlike 4.0 International