EOS Reweighting#

Unlike the other samplers on this page, EOS reweighting does not sample a parametric equation-of-state model at all. Instead, it takes a fixed, discrete set of tabulated EOS curves: for example, a set of prior samples produced elsewhere, or a family of curves from a nuclear-theory calculation, or even a non-parametric method such as Gaussian processes. Given these EOSs, we can evaluate jester’s likelihoods directly on each curve. The result is a discrete posterior over the input EOS set. Since jester is quite fast due to JAX, we can evaluate 100 000 EOSs in under 1 minute on a laptop, offering a flexible and fast way to reweight any EOS set against the suite of likelihoods offered in jester.

The input is fairly minimal and only needs the tabulated \((M, \Lambda, R)\) curves for each EOS. Therefore, for now, we only support likelihoods that depend purely on these neutron-star observables: GW, NICER, and radio timing. Likelihoods that need the underlying EOS structure — density, pressure, sound speed, and so on, such as \(\chi\)EFT, are not yet available in this mode, since that information is not part of the tabulated input. Moreover, since these likelihoods can be cheaply evaluated at the EOS generation step as they do not require TOV solutions, users may wish to incorporate any such information at the prior generation step before reweighting. Support for these may be added in the future by also tabulating the relevant EOS quantities. For now, the config validator raises a clear error if an unsupported likelihood type is enabled.

lwp#

The process described above is quite similar (and in fact, heavily inspired by) the lwp EOS reweighting pipeline (available on the LIGO GitLab https://git.ligo.org/reed.essick/lwp), but using the jester functionalities, bridging between jester and any external EOS-generation pipelines. Any codebase that can produce a set of \((M, \Lambda, R)\) curves can have those curves scored by jester’s likelihood stack without needing to reimplement, e.g., the GW and NICER likelihoods.

How it works#

An input NPZ file supplies a set of \(N\) EOS curves as arrays of mass, radius and tidal deformability with keys masses (in Msun), radii (in km) and lambdas. All curves are resampled onto a common mass grid spanning m_min to m_max (or, if m_max is not given, the maximum TOV mass across the input set, capped at 3 solar masses), with \(\Lambda\) and \(R\) set to zero above each curve’s own maximum mass. The combined likelihood is then evaluated once per curve using jax.lax.map() with a fixed batch size, with progress logged after each batch. Given the per-curve log-likelihoods, and assuming uniform prior weights, the effective sample size and evidence are computed as well, which allow us to compare different EOS sets.

Since every input EOS carries its own (unequal) posterior weight, sample() finishes by drawing an equal-weight set of posterior samples through weighted resampling with replacement, using resample_eos_posterior(). By default it draws \(N_\mathrm{eff}\) samples (the Kish effective sample size already computed for the evidence), which can be overridden via n_resample. This resampled set is what gets plotted and is the natural entry point for further analysis, since it behaves like any other equal-weight posterior. resample_eos_posterior() is a small, self-contained public function, so it works just as well on a fresh EOS set you reweighted yourself outside of EOSReweightingSampler — see the reweighting example notebook listed down below.

Configuration#

sampler:
  type: "eos-reweighting"
  eos_file: "path/to/eos.npz"    # NPZ with keys: masses, lambdas, radii
  n_grid: 200                    # mass-grid points (default: 200)
  m_min: 1.0                     # lower mass bound in M_sun (default: 1.0)
  m_max: null                    # upper bound; null -> max(M_TOV) across curves, capped at 3.0 M_sun
  batch_size: 1000               # lax.map batch size (default: 1000); tune to fit memory requirements
  n_resample: null               # posterior sample count; null -> N_eff (rounded)
  output_dir: "outdir/eos_reweighting/"

postprocessing:
  enabled: true                   # default: true
  injection_eos_path: null        # optional NPZ with the injected/true EOS
  plot_format: "pdf"              # "pdf" or "png"

Because the EOS is supplied as tabulated curves rather than sampled, this sampler does not require an eos, tov, or prior section in the YAML config — see the dedicated top-level schema EOSReweightingInferenceConfig. Full field-by-field documentation, including the expected NPZ layout and the result.h5 output structure, is in the YAML reference.

Postprocessing only produces the mass-radius and mass-Lambda plots, since the resampled posterior only contains \((M, \Lambda, R)\) curves. It runs automatically after run_jester_inference config.yaml and can also be triggered standalone with run_jester_postprocessing config.yaml. To overlay a known injected EOS, point injection_eos_path at an NPZ file in the format expected by load_injection_eos() — the tabulated LALSuite EOS tables shipped under jesterTOV/tabulated_eos/lalsuite/ (e.g. MPA1.npz, SLY230A.npz) already follow this format and are convenient injections for validation runs.

A complete working example, including a notebook walking through the reweighting workflow and the resampling API, is in examples/inference/reweighting/.

API reference#