Skip to content

Commit

Permalink
added missing figures and latest changes to paper
Browse files Browse the repository at this point in the history
  • Loading branch information
zixiao-h committed Nov 9, 2023
1 parent 93ffb82 commit e0ea484
Show file tree
Hide file tree
Showing 10 changed files with 377 additions and 100 deletions.
19 changes: 9 additions & 10 deletions paper/edits.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
## General comments:

1) You should expand the citation list. Buchner's review is an excellent source (and should also be cited alongside Ashton):
<!-- 1) You should expand the citation list. Buchner's review is an excellent source (and should also be cited alongside Ashton): -->

https://arxiv.org/abs/2101.09675
<!-- https://arxiv.org/abs/2101.09675 -->

In particular you should cite anything which looks relevant from the 'Theory' section in 4.
<!-- In particular you should cite anything which looks relevant from the 'Theory' section in 4. -->

2) The abstract and conclusion should also mention that we have a detailed discussion of the anatomy of nested sampling, and present new analytic results for understanding this.
<!-- 2) The abstract and conclusion should also mention that we have a detailed discussion of the anatomy of nested sampling, and present new analytic results for understanding this. -->

4) 4.2 should have a few sentences indicating that whilst a more complete Bayesian approach might be possible, as we wish this to be done at run-time we opt for a more pragmatic method for estimating the end point.
<!-- 4) 4.2 should have a few sentences indicating that whilst a more complete Bayesian approach might be possible, as we wish this to be done at run-time we opt for a more pragmatic method for estimating the end point. -->
<!-- 3) is it possible to put the dead points onto Figures 3 & 4? This would be a horizontal line in the former, and something power-law/exponential in the latter, continuously connected to the peak of the live point distribution -->

## More minor suggestions:

- Mention Skilling's paper when discussing uncertainties in evidence at end of section 2
- When you make the statement 'the remaining live points are then killed off one-by-one', could you emphasise that this is quantitatively equivalent to the phrasing of the existing literature (which treats the evidence in the final live points separately), but qualitatively neater (cite the dynesty paper here).
- Is it possible to have some line pairing the axvlines in the lower panel with the the corresponding upper panels (in analogy with Figure 3)
<!-- - When you make the statement 'the remaining live points are then killed off one-by-one', could you emphasise that this is quantitatively equivalent to the phrasing of the existing literature (which treats the evidence in the final live points separately), but qualitatively neater (cite the dynesty paper here). -->
<!-- - Is it possible to have some line pairing the axvlines in the lower panel with the corresponding upper panels (in analogy with Figure 3) -->
<!-- - Mention Skilling's paper when discussing uncertainties in evidence at end of section 2 -->
<!-- - In Figure 2, can we colour the successive live points in different colours (as in the original plot) -->
<!-- - eq (22) -- can we label this something other than $\beta^*$ -- I would rather call the Habeck temperature $\beta^*$, since in the end this is our concluded best temperature -->
<!-- - "Define a likelihood normalised": sentence fragment -->
Expand All @@ -29,7 +28,7 @@ In particular you should cite anything which looks relevant from the 'Theory' se
<!-- it was rightly pointed out to me by Torsten Ensslin that (27) is not dimensionally consistent! You can also cite Will Handley "The scaling frontier of nested sampling" (Nov 2023) in prep alongside that talk. -->

## Other
I didn't spot many typos, but ideally you should run this through LanguageTool (overleaf plugin) or equivalent
<!-- I didn't spot many typos, but ideally you should run this through LanguageTool (overleaf plugin) or equivalent -->

After you've made the above adjustments, you should pass a copy by Artyom <[email protected]>, in particular checking the spelling of his name (he uses multiple spellings, so should choose the one he wants to be 'permanent' were he to pursue an academic career -- quote me on this.

32 changes: 21 additions & 11 deletions paper/figures/d_G_elongated.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,55 @@
import matplotlib.pyplot as plt
from aeons.utils import *
from aeons.plotting import *
from matplotlib.gridspec import GridSpec
figsettings()
from matplotlib.gridspec import GridSpec

name, samples = get_samples('correlated_6d', reduced=False)
iterations, *d_Gs = read_from_txt(f'{data_dir}/d_Gs/post/{name}.txt')
logXs = samples.logX().iloc[iterations]
d_Gs = np.array(d_Gs)

fig = plt.figure(figsize=(3.5, 3))
gs = GridSpec(2, 3, wspace=0.1, hspace=0.35)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[0, 1])
ax3 = fig.add_subplot(gs[0, 2])
ax4 = fig.add_subplot(gs[1, :])
gs = GridSpec(2, 3, wspace=0.1, hspace=0.1)
ax1 = fig.add_subplot(gs[0, 0], zorder=1)
ax2 = fig.add_subplot(gs[0, 1], zorder=1)
ax3 = fig.add_subplot(gs[0, 2], zorder=1)
ax4 = fig.add_subplot(gs[1, :], zorder=0)
axs = [ax1, ax2, ax3, ax4]

logXstars = [-1, -8, -30]
logXstars = [-0.5, -8, -30]
logX = samples.logX()
# Find index of logX closest to logXstar
ndeads = [np.argmin(np.abs(logX - logXstar)) for logXstar in logXstars]

for i, ndead in enumerate(ndeads):
ax = axs[i]
live_points = points_at_iteration(samples, ndead).iloc[ndead:]
live_points.drop_weights().plot.scatter(0, 4, ax=ax, s=5)
live_points.drop_weights().plot.scatter(0, 4, ax=ax, s=5, color='lightseagreen')
ax.set_aspect('equal')
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
ax.set_xticks([])
ax.set_yticks([])
ax.set_xlabel('')
ax.set_ylabel('')
ax4.axvline(-logXstars[i], lw=1)
# ax4.axvline(-logXstars[i], lw=1)

ax2.set_xlabel(r"$\sigma = 10^{-3}$", fontsize=8)
ax2.xaxis.set_label_position('top')
ax1.set_ylabel(r"$\sigma = 10^{-6}$", fontsize=8)
plot_quantiles(-logXs, d_Gs, 6, (0, 1.2), color='lightseagreen', ax=ax4)
ax4.set_title('Inferred dimensionality as run proceeds', fontsize=8)
ax4.set_xlabel(r'$-\log X$', fontsize=8)
ax4.set_ylabel(r'$\hat{d}_G$', fontsize=8, rotation=0, labelpad=10)
ax4.margins(x=0)
fig.suptitle('Set of live points as run proceeds', fontsize=8, y=0.92)

dims = [1.5, 3.2, 6]
from matplotlib.patches import ConnectionPatch
for i, logXstar in enumerate(logXstars):
con = ConnectionPatch(xyA=(0.5, 0), xyB=(-logXstar, dims[i]), coordsA="data", coordsB="data",
axesA=axs[i], axesB=ax4, color="C0", zorder=0.5)
fig.add_artist(con)
con.set_in_layout(False)

fig.suptitle('Live points and dimensionality as run proceeds', fontsize=8, y=0.95)
fig.savefig('d_G_elongated.pdf', pad_inches=0.02, bbox_inches='tight')
108 changes: 108 additions & 0 deletions paper/figures/figures.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion paper/figures/inc_predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
plot_quantiles(-logXs, -logXfs, -true_logXf, ax=ax, label='Fit $\\mathcal{L}(X)$')

ax.set_ylim(0, 160)
ax.set_ylabel(r'$-\log \hat{X}_f$')
ax.set_ylabel(r'$-\log \hat{X}_\mathrm{f}$')
ax.set_xlabel(r'$-\log X$')
ax.legend(loc='upper right', fontsize=6)
ax.margins(x=0)
Expand Down
4 changes: 2 additions & 2 deletions paper/figures/last_live_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
points = points_at_iteration(samples, ndead)
beta_grad = np.exp(get_logbeta_grad(points, ndead))
betas = [0, beta_grad, 1]
labels = ['$\\beta=1$', '$\\beta = \\beta^*$', '$\\beta = 0$']
labels = ['$\\beta=1$', '$\\beta = \\beta_i$', '$\\beta = 0$']
colors = ['darkgray', 'orange', 'black']

fig, axs = plt.subplots(1, 2, figsize=(3.5, 1.3))
Expand All @@ -33,7 +33,7 @@
ax.margins(x=0.02)
ax.set_ylim(-0.01, 1.1)
ax.set_yticks([])
ax.set_xticks([0, -points.logX().iloc[ndead]], [0, r'$-\log X^*$'])
ax.set_xticks([0, -points.logX().iloc[ndead]], [0, r'$-\log X_i$'])
axs[0].set_title(r'$\mathcal{L}^\beta$', fontsize=8)
axs[1].set_title('$\\mathcal{P}(\\log X) = \\mathcal{L}^\\beta X$', fontsize=8)
axs[0].legend(loc='upper left', fontsize=5)
Expand Down
2 changes: 1 addition & 1 deletion paper/figures/logL_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
logLmaxlive,
logLmax])
ax.set_xticklabels([r'$\langle\log\mathcal{L}\rangle_\mathcal{P}$',
r'$\log\mathcal{L}_\mathrm{end}$',
r'$\log\mathcal{L}_i$',
r'$\log\mathcal{L}_\mathrm{max}^\mathrm{live}$',
r'$\log\mathcal{L}_\mathrm{max}$'],
fontsize=8)
Expand Down
4 changes: 2 additions & 2 deletions paper/figures/logX_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def gaussian(x, mu, sig):

# Arrows showing \Delta\log X
pad_text = 0.05
ax.annotate(r'$\Delta\log X = -\frac{1}{n_\mathrm{live}}$', (-ndead/nlive - 1, lpoints+pad_text), ha='center', va='bottom', fontsize=8)
ax.annotate(r'$\Delta\log X = -\frac{1}{n_{i}}$', (-ndead/nlive - 1, lpoints+pad_text), ha='center', va='bottom', fontsize=8)
arrow_start = (-ndead/nlive, lpoints)
arrow_end = (-ndead/nlive - 1.5, lpoints)
arrow = patches.FancyArrowPatch(arrow_start, arrow_end, arrowstyle='->', mutation_scale=5)
Expand All @@ -63,7 +63,7 @@ def gaussian(x, mu, sig):
ax.add_patch(arrow)
ax.annotate("Iterations", (-25, l1+pad_text), ha='center', va='bottom', fontsize=8)

ax.set_xticks([logXf, -DKL, ElogXlivemin, -ndead/nlive, 0], [r"$\log X_\mathrm{f}$", r'$-\mathcal{D}_\mathrm{KL}$', r'$\langle\log X_\mathrm{min}^\mathrm{live}\rangle$', r'$\langle\log X^*\rangle$', '$0$'], fontsize=8)
ax.set_xticks([logXf, -DKL, ElogXlivemin, -ndead/nlive, 0], [r"$\log X_\mathrm{f}$", r'$-\mathcal{D}_\mathrm{KL}$', r'$\langle\log X_\mathrm{min}^\mathrm{live}\rangle$', r'$\langle\log X_i\rangle$', '$0$'], fontsize=8)
ax.set_yticks([])
ax.set_ylim(0, 1.05)
ax.margins(x=0)
Expand Down
Binary file modified paper/paper.pdf
Binary file not shown.
Loading

0 comments on commit e0ea484

Please sign in to comment.