Spatially Varying Coefficient (SVC) modelling with GGP-GAMs
GAM (General Additive Models) are emerging as the goto approach for all kinds of data science activities. GAMS perform as well or better than most machine learning models and they are relatively fast. They are powerful and quick but critically they offer a middle ground between overly simple but interpretable standard statistical approaches, and efficient but opaque machine leaning algorithms, where it is difficult to understand how one variable relates to an outcome. Their beauty is that they can handle and model different types of statical relationships, and provide an intuitive approach for modelling relatively complex relationships in data with complex interactions and non-linearities. The outputs provide easily understood measures of the relationship between predictor and response variables, and how the outcome is modelled. Crucially for the spatial sciences, including urban planning and management, they can be adapted to generate spatial outputs that show how and where the relationship with outcome vary in space and time, in Gaussian Process (GP) splines are included in the GAM model..
This hands workshop will introduce GAMs, provide the opportunity for attendees to undertake a GAM analysis of data describing processes related to an urban informatics case study, to interpret and visualise the outputs, to apply a location aware GAM. The workshop will demonstrate how to quantify the varying spatial relationships between different driving factors and an outcome, and support users in applying a spatial GAM to their problem (please bring data!).
The workshop will have a strong hands-on element and attendees will need to have a basic understanding of R/ RStudio.
At the end of this master class attendees will:
- be able to apply and a tune a GAM with GP splines
- understand what constitutes a “good” GAM model
- be able to undertake spatially varying coefficient modelling using GP GAMs and interpret and visualise (map) the outputs
- have a robust understanding of how to apply GAMs to urban and regional systems
R scripts for each part of the workshop are provided.
Location and Time: Room 232, Leacock Building, 13:30 - 17:00, 22 June 2023
Part 1: GAM with Splines (13:30 - 15:00)
- Talk: Welcome and introduction to GAMs (15 mins)
- RStudio Practical:
- Set up and Datasets
- GAMs with splines / smooths
Break (15:00 - 15:30)
Part 2: SVCs with GGP-GAMs (15:30 - 16:30)
- Talk: Introduction to SVCs (15 mins)
- RStudio Practical:
- GAMs with Geographic smooths (GGP-GAM)
- Tuning GGP-GAMs
- Mapping and Interpreting GGP-GAM SVCs
Part 3: Wrap up (16:30)
- Talk: GGP-GAM wrap up
The expectation is that you are familial with coding in R and the RStudio environment.
if you have not used R for a and need a refresher some good on-line get started in R guides include:
- The introduction to my 3rd year under-graduate module: https://bookdown.org/lexcomber/GEOG3195/#r-refresh-if-you-have-not-used-r-before
- The Owen guide (only up to page 28): https://cran.r-project.org/doc/contrib/Owen-TheRGuide.pdf
- An Introduction to R - https://cran.r-project.org/doc/contrib/Lam-IntroductionToR_LHL.pdf
- R for beginners https://cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
And of course there are other texts that take the reader from ‘numpty to ninja’ (i.e. ’zero to hero`):
- Lovelace et al. (2019): https://bookdown.org/robinlovelace/geocompr/
- Comber and Brunsdon (2021), provide a through grounding of the spatial analysis in R and the code for each chapter is here: https://study.sagepub.com/comber/student-resources/code-library
- Brunsdon and Comber (2018), provides a comprehensive introduction to R and for spatial data analytics: https://uk.sagepub.com/en-gb/eur/an-introduction-to-r-for-spatial-analysis-and-mapping/book258267.
This worksheet has shamelessly borrowed from the following resources that you may find useful:
- GAM: The Predictive Modeling Silver Bullet by Kim Larsen - https://multithreaded.stitchfix.com/blog/2015/07/30/gam/
- Generalized Additive Models by Michael Clark - https://m-clark.github.io/generalized-additive-models/