Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Marked Spatiotemporal Poisson Process — From Scratch and With NumPyro

Open In Colab

A marked spatiotemporal point process attaches an attribute mim_i — a mark — to each event (si,ti)(s_i, t_i). Under the separable factorisation λ(s,t,m)=λ(s,t) f(m∣s,t)\lambda(s, t, m) = \lambda(s, t) \, f(m \mid s, t), the joint log-likelihood splits into ground (location, time) and mark contributions:

log⁡L=∑i[log⁡λ(si,ti)+log⁡f(mi∣si,ti)]−Λ.\log L = \sum_i [\log \lambda(s_i, t_i) + \log f(m_i \mid s_i, t_i)] - \Lambda.

We use an earthquake-style example: a homogeneous space-time ground process plus magnitudes drawn from an Exponential mark distribution (the Gutenberg–Richter shape after a magnitude shift). The mark rate scales with time so larger events tend to occur later — a synthetic stand-in for a stress-release effect.

Setup

/home/azureuser/localfiles/xtremax/.venv/bin/python: No module named pip
Note: you may need to restart the kernel to use updated packages.
/home/azureuser/localfiles/xtremax/.venv/lib/python3.13/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm

1. From scratch — the primitives layer

Ground draw: 179 events.

Sample marks (location- and time-dependent)

Magnitude rate scales with time so events later in the window have larger marks on average.

Real-event mark range: 0.000 – 16.037

Visualise: scatter on (x, y) with marker size proportional to mark, colour by time.

<Figure size 600x500 with 2 Axes>
<Figure size 600x350 with 1 Axes>

Joint log-likelihood = ground + marks

log L_ground  = -364.016
log L_marks   = -249.209
log L_joint   = -613.225

2. With NumPyro — recover the rate and the time-magnitude slope

rate: posterior mean = 0.361, 95% CI = [0.315, 0.417], true = 0.4
beta_t: posterior mean = 0.382, 95% CI = [0.297, 0.474], true = 0.4
<Figure size 1000x320 with 2 Axes>