Skip to content

mitzimorris/geomed_2024

Repository files navigation

This repository contains a series of notebooks developed for workshop Spatial Modeling with Stan at GeoMed 2024.

The goals of this workshop are twofold:

  • To introduce new users to existing implementations of spatial models in Stan and the corresponding tools and workflow for model validation and comparison.
  • To provide researchers with the necessary understanding of Stan language syntax and computation so that they can develop custom models and extend existing ones.

This repository contains the R and Python Jupyter notebooks, stan models, and datasets. Files are named "h1" through "h6" (h for "handout"). The directory stan contains all Stan files presented in these notebooks, and the data directory contains the example dataset used for all notebooks. The HTML has been generated by running the Python code. The corresponding R code is shown as well. The code as written assumes that it is being run from within the python-notebooks or r-notebooks directories and uses relative paths to access the example data and Stan models.

  • Notebook "h2_spatial_data" shows how to work with GIS data using Python packages libpysal and plotnine and R packages sf, spdep, and ggplot2.

  • Notebook "h3_stan_workflow" introduces the basic concept of stepwise model development. It demonstrates key data transforms and general best practices.

  • Notebook "h4_icar" introduces the Intrinsic Conditional Auto-Regressive model, the computationally tractible component for spatial smoothing.

  • Notebook "h5_bym2" introduces the BYM2 model, a widely-used model for spatial epidemiology.

  • Notebook "h6_bym2_multicomp" extends the BYM2 model to larger, more complex maps with disconnected regions and islands.

I hope you find these useful, whether learning Stan, spatial modeling, or learning Python from R and vice versa.

About

Spatial Models in Stan

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages