---
# System prepended metadata

title: ESS Grid Plots

---

# ESS Grid Plots

Let us observe the ESS of the negative log target density across parameter values. For HMC, the relevant parameters are step size $\delta$ and number of leapfrog steps $L$. For RHMC/GHMC, they are step size $\delta$ and update rate $\kappa$. We sample on the following target densities.
- 2D isotropic Gaussian
- 2D ill-conditioned Gaussian with $\sigma = [1,5]$
- 10D isotropic Gaussian
- 10D ill-conditioned Gaussian with $\sigma = [1,\dots,10]$

## ESS/Sample

First, we consider ESS/number of samples. Caution: the color bars differs across experiments. Using one consistent color bar throughout would render some plots completely dark.

## RHMC/GHMC Samplers

- Heatmap: ESS/sample of (negative) log target density (computed by Arviz)
- x-axis: Step size $\delta$ (Left to right &rarr; small to large)
- y-axis: Update rate $\kappa$ (Top to bottom &rarr;  log-spaced $10^{-2}$ to $10^2$ for all targets)
- "Reparam": Parameterization of momentum updates by just $\kappa$ instead of $\kappa \delta$. This is done by simply feeding in $\kappa/\delta$ as the update rate argument so that in the computation $\kappa/\delta \times \delta$ cancels to give just $\kappa$.

|Sampler | 2D Isotropic  <br> $(0.01 \leq \delta \leq 2)$ |  2D Ill-Cond <br> $(0.01 \leq \delta \leq 5)$| 10D Isotropic <br> $(0.01 \leq \delta \leq 2)$ | 10D Ill-Cond $(0.01 \leq \delta \leq 5)$|
:------:|:------------:|:------------:|:-------------:|:-----------:|
RHMC-F |![](https://i.imgur.com/OqH0HSj.png =150x150)|![](https://i.imgur.com/wczRMeg.png =150x150)|![](https://i.imgur.com/1O6V08F.png =150x150)|![](https://i.imgur.com/hRd6RbD.png =150x150)|
RHMC-F (reparam)|![](https://i.imgur.com/wFE10Dy.png =150x150)|![](https://i.imgur.com/qiAzU2c.png =150x150)|![](https://i.imgur.com/K3iTSJy.png =150x150)|![](https://i.imgur.com/JeW6p1i.png =150x150)|
RHMC-AR|![](https://i.imgur.com/i0BTyZM.png =150x150) |![](https://i.imgur.com/onVkg3g.png =150x150)|![](https://i.imgur.com/3WrrIGE.png =150x150)|![](https://i.imgur.com/r8PmXNl.png =150x150)|
RHMC-AR (reparam) |![](https://i.imgur.com/0H3NUs8.png =150x150)|![](https://i.imgur.com/QxTwBCH.png =150x150)|![](https://i.imgur.com/kd2Zz2e.png =150x150)|![](https://i.imgur.com/NU3SoYs.png =150x150)|
GHMC |![](https://i.imgur.com/3dna3V2.png =150x150)|![](https://i.imgur.com/PnTx3qz.png =150x150)|![](https://i.imgur.com/3XT4Izg.png =150x150)|![](https://i.imgur.com/aIeDW3A.png =150x150)|
GHMC (reparam) |![](https://i.imgur.com/eQ5RigO.png =150x150)|![](https://i.imgur.com/7HjHpvW.png =150x150)|![](https://i.imgur.com/WffaVtW.png =150x150)|![](https://i.imgur.com/XkufTgG.png =150x150)|


## HMC Sampler

- Heatmap: ESS/sample of (negative) log target density (computed by Arviz)
- x-axis: Step size $\delta$ (Left to right &rarr; $0.01$ to $2.2$ for all targets)
- y-axis: Number of leapfrog steps $L$ (Top to bottom &rarr; small to large)

|2D Isotropic  <br> $L\in[1,100]$ |  2D Ill-Cond <br> $L\in[1,100]$ | 10D Isotropic <br> $L\in[1,50]$  | 10D Ill-Cond $L\in[1,50]$ |
|:------------:|:------------:|:-------------:|:-----------:|
|![](https://i.imgur.com/9Z0O1RR.png =200x150)|![](https://i.imgur.com/DDhX4Ns.png =200x150)|![](https://i.imgur.com/MVEVsN2.png =200x150)|![](https://i.imgur.com/BTGecWi.png =200x150)|


# ESS/cost Grid Plots

Now, we consider cost = total number of gradient calls. For HMC, the cost is proportional to number of leapfrog steps. For RHMC, the cost is total number of samples (one gradient evaluation per sampler iteration) + total number of reflections. No changes for GHMC where 1 sample = 1 gradient evaluation.

## RHMC/GHMC Samplers

|Sampler | 2D Isotropic  <br> $(0.01 \leq \delta \leq 2)$ |  2D Ill-Cond <br> $(0.01 \leq \delta \leq 5)$| 10D Isotropic <br> $(0.01 \leq \delta \leq 2)$ | 10D Ill-Cond $(0.01 \leq \delta \leq 5)$|
:------:|:------------:|:------------:|:-------------:|:-----------:|
RHMC-F |![](https://i.imgur.com/89fJibB.png =150x150)|![](https://i.imgur.com/89EerIS.png =150x150)|![](https://i.imgur.com/apqsOhe.png =150x150)|![](https://i.imgur.com/6ZB3cpu.png =150x150)|
RHMC-F (reparam)|![](https://i.imgur.com/2qZ9Sep.png =150x150)|![](https://i.imgur.com/OfOrSbo.png =150x150)|![](https://i.imgur.com/P4lI3kc.png =150x150)|![](https://i.imgur.com/CGpKzTr.png =150x150)|
RHMC-AR|![](https://i.imgur.com/qaIg475.png =150x150) |![](https://i.imgur.com/8Dhlz75.png =150x150)|![](https://i.imgur.com/ohJqy8W.png =150x150)|![](https://i.imgur.com/L7jrQzt.png =150x150)|
RHMC-AR (reparam) |![](https://i.imgur.com/05Iz8Wg.png =150x150)|![](https://i.imgur.com/7hnxVsh.png =150x150)|![](https://i.imgur.com/PJ2T5gd.png =150x150)|![](https://i.imgur.com/M8UhVzy.png =150x150)|


## HMC Sampler

|       2D Isotropic  <br> $L\in[1,100]$        |        2D Ill-Cond <br> $L\in[1,100]$         |        10D Isotropic <br> $L\in[1,50]$        |           10D Ill-Cond $L\in[1,50]$           |
|:---------------------------------------------:|:---------------------------------------------:|:---------------------------------------------:|:---------------------------------------------:|
| ![](https://i.imgur.com/KJJ3cw3.png =200x150) |![](https://i.imgur.com/gPgpcyc.png =200x150) | ![](https://i.imgur.com/noNMpaE.png =200x150) | ![](https://i.imgur.com/9taVPZ8.png =200x150) |





