Mastering Network Spatial Statistics with the MetricGraph R Package

About

A new open-access mini-course is expanding access to advanced network spatial statistics through practical training with the MetricGraph package R, a powerful tool developed by David Bolin (KAUST), Alexandre B. Simas (KAUST), and Jonas Wallin (Lund University) for modeling data on network structures such as road systems and river basins. Presented by Bolin and Simas at the University of Glasgow during the “INLA: Past, Present, and Future” workshop, the mini-course provides step-by-step tutorials, real datasets, and comprehensive R code, all freely available online, opening new avenues for researchers and students globally.

With network-based data increasingly collected across diverse scientific fields, tailored statistical methods have become essential. Traditional spatial tools often fail to adequately handle data restricted by complex network geometries. MetricGraph addresses these limitations, offering a flexible and computationally efficient approach to constructing metric graphs, modeling network-constrained random fields, and fitting sophisticated Bayesian models. This initiative democratizes access to state-of-the-art spatial statistics, fostering innovation in areas such as urban transportation, environmental monitoring, epidemiology, and neuroscience.

The MetricGraph mini-course guides participants through a complete analytical workflow via practical examples. One tutorial demonstrates spatial analysis of Madrid’s urban traffic, illustrating the creation of a metric graph from OpenStreetMap data, integration of traffic sensor measurements, and visualization of spatial patterns across 145 kilometers of roads. Participants learn to fit spatial random field models, such as the Whittle–Matérn model, interpret key spatial parameters, and predict data at unobserved locations. The course also highlights integration with R-INLA and inlabru for efficient Bayesian inference. All tutorials are supported by openly available datasets, R scripts, and lecture slides, enabling easy replication and adaptation for new research applications.

The MetricGraph framework efficiently manages large, complex network structures, supports Gaussian random fields and stochastic partial differential equations on graphs, and utilizes sparse matrix computations for scalable inference. Enhanced visualization capabilities using popular R packages like ggplot2 and leaflet further reinforce its utility as a contemporary tool for applied spatial statistics on networks. For more information and access to course materials, visit the MetricGraph homepage or the course GitHub repository.