Online Resource 1 for: "A local asymptotic minimax bound for evidence estimation from ideal nested sampling runs"
Journal: Statistics and Computing
Author: Sahibzada Allahyar, Fastino Labs, San Francisco, USA (sahibzada@fastino.ai)

Simulations for "A local asymptotic minimax bound for evidence estimation from ideal nested
sampling runs"

Files (all in the code/ directory of Online Resource 1)
  sim_lib.py        likelihood curves, quadrature for p, P, sigma^2, H, D, and the estimators
  sim_run.py        runs one experiment for one seed: main (fixed problem, Section 4.1),
                    local (local neighbourhood, Section 4.2), local-check (high-precision check
                    of the standard estimator in Appendix C.4), allocation (Section 4.3)
  sim_figs.py       pools the per-seed output and writes sim_summary.json, tab_sim.tex,
                    tab_alloc.tex, fig_curves.pdf (Fig. 1) and fig_local.pdf (Fig. 3)
  sim_fig_risk.py   reads sim_summary.json and writes fig_risk.pdf (Fig. 2)
  pool_local.py     pools the local-check output and prints the ratios quoted in Appendix C.4
  sim_output/       per-seed output (raw moments of the errors). File names carry a short tag
                    for each experiment: main_<seed>.json (main, seeds 1-16),
                    local_<seed>.json (local, seeds 1-8), localcheck_<seed>.json (local-check,
                    seeds 101-140), allocation_<seed>.json (allocation, seeds 1-8)

Software
  Python 3.8 or later, NumPy 1.20 or later, SciPy 1.7 or later (scipy.special.gammaln only),
  Matplotlib 3.4 or later (figure scripts only). These are minimum versions consistent with
  the functions used (the random generator is numpy.random.default_rng).

Commands, run from the code/ directory (the directory that contains these files)
  mkdir -p sim_output && cd sim_output
  for seed in $(seq 1 16); do PYTHONPATH=.. python ../sim_run.py main $seed 1250; done
  for seed in $(seq 1 8); do for exp in local allocation; do PYTHONPATH=.. python ../sim_run.py $exp $seed 2500; done; done
  for seed in $(seq 101 140); do PYTHONPATH=.. python ../sim_run.py local-check $seed 2500; done
  cd ..
  python sim_figs.py        # tables, Figs. 1 and 3, sim_summary.json
  python sim_fig_risk.py    # Fig. 2, from sim_summary.json
  python pool_local.py      # ratios and sigma^2_{F_h}/sigma_0^2 quoted in Appendix C.4

The pooled results have 20000 runs per configuration (100000 for local-check: standard
estimator, Gaussian d = 10, N = 400). For the file tags used in the seed formula
(A, B, B2, C for main, local, local-check, allocation), the random generator for tag x is
numpy.random.default_rng(1000 * seed + ord(x[0]) + 7 * (len(x) - 1)).

Notes
  The smoothed estimator averages each value over a centred window of n_w = 2*floor(N/10) + 1
  values; the first n_w and the last n_w values are left unsmoothed.
  The local-slope estimator extrapolates the first increment linearly and gives non-positive
  increments the shrinkage 1/N.
