Skip to content

RohanGautam/EIV_IGP_jax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EIV IGP

My implementation of the EIV IGP model in numpyro/JAX. Used for calculating bayesian estimates for rates of sea level change. The rates are integrated to produce the sea level curves. The original code was implemented in R/JAGS.

Sea level curve Sea level rate

Features

  • 🚀 Enables running MCMC on the GPU
  • ⚡ Supports SVI estimates for extremely fast posterior inference
  • 🐍 Clean, pythonic interface
  • 🧠 Easy to understand codebase (my biased opinion)

Setup and Usage

  • Make sure you have uv installed on your system.
  • Update main.py to point to your data file.
  • Run uv run main.py in your terminal.

This will run the full EIV IGP model on your data with 2 MCMC chains in parallel.

If you want to include a GIA rate, change the gia_rate argument in the data.preprocess call.

To have a quick look at the workflow and some figures, look at the ./example.ipynb notebook. It has other useful examples - data processing, MCMC, and SVI estimates.

Benchmarks

On my M2 pro chip, CPU performance on a single chain with the default NYC dataset takes ~6 min. The same thing takes ~20 min in the original code.

Screenshots

Data plotting

Data

Sea level curve

alt text

Sea level rate

alt text

Model render

Model

About

The EIV IGP model built and sped up with JAX

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors