Accelerated Bayesian Inference for Pulsar Timing Arrays: Normalizing Flows for Rapid Model Comparison Across Stochastic Gravitational-Wave Background Sources
Junrong Lai, Changhong Li · 2025
Read Accelerated Bayesian Inference for Pulsar Timing Arrays: Normalizing Flows for Rapid Model Comparison Across Stochastic Gravitational-Wave Background Sources by Junrong Lai, Changhong Li (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-04211.txt.
Introduction
Junrong Lai and Changhong Li speed up the hunt for the source of a cosmic hum, in a 2025 paper. Pulsar timing arrays have detected a faint background of gravitational waves at very low frequencies. Telling which source made the hum means comparing many models, and the standard sampling method takes about ten days per dataset.
The pair train a type of neural network called a normalizing flow on the fifteen-year NANOGrav dataset. The trained network estimates how well each of ten source models fits, from merging giant black holes to cosmic strings and early-universe events. Total time drops to about twenty hours. Accuracy in picking between models stays close to the slow method. Faster checks let scientists test new ideas about the hum as fresh data arrives.
Catalog record
| CREATOR | Junrong Lai, Changhong Li |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 56 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2504-04211
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Accelerated Bayesian Inference for Pulsar Timing Arrays: Normalizing Flows for Rapid Model Comparison Across Stochastic Gravitational-Wave Background Sources Junrong Lai, Changhong Li Abstract The recent detection of nanohertz stochastic gravitational-wave backgrounds (SGWBs) by pulsar timing arrays (PTAs) promises unique insights into astrophysical and cosmological origins. However, traditional Markov Chain Monte Carlo (MCMC) approaches become prohibitively expensive for large datasets. We employ a normalizing flow (NF)-based machine learning framework to accelerate Bayesian inference in PTA analyses. For the first time, we perform Bayesian model comparison across SGWB source models in the framework of machine learning by training NF architectures on the PTA dataset (NANOGrav 15-year) and enabling direct evidence estimation via learned harmonic mean estimators. Our examples include 10 conventional SGWB source models such as supermassive black hole binaries, power-law spectrum, cosmic strings, domain walls, scalar-induced GWs, first-order phase transitions, and dual scenario/inflationary gravitational wave. Our approach jointly infers 20 red noise parameters (10 pulsars) and 2 SGWB parameters per model in ∼ 20 \sim 20 hours (including training), compared to ∼ 10 \sim 10 days with MCMC (68 pulsars). Critically, the NF method preserves rigorous model selection accuracy, with small Hellinger distances ( ≲ 0.3 \lesssim 0.3 ) relative to MCMC posteriors, and reproduces MCMC-based Bayes factors across all tested scenarios. This scalable technique for SGWB source comparison will be essential for future PTA expansions and next-generation arrays such as the SKA, may offer substantial efficiency gains without sacrificing physical interpretability. I Introduction Pulsar timing arrays (PTAs)—including NANOGrav [ 1 ] , EPTA [ 2 ] , PPTA [ 3 ] , IPTA [ 4 ] , and CPTA [ 5 ] —have reached unprecedented timing precision, enabling detection of a stochastic gravitational-wave background (SGWB) through spatially correlated fluctuations in pulsar timing residuals. A key hallmark of such detection is the Hellings-Downs (HD) correlation [ 6 ] , recently reported by multiple PTA collaborations [ 7 , 2 , 8 , 9 , 5 ] . Theoretical models for SGWB generation span a wide landscape, including mergers of supermassive black hole binaries (SMBHBs), first-order phase transitions (FOPT), cosmic strings, domain walls, scalar-induced GWs, and inflationary/bouncing universe scenarios (see Appendix C for details of these models). Discriminating among these possibilities requires Bayesian inference on a growing number of high-dimensional parameters across diverse spectral shapes. However, traditional Bayesian tools—such as Markov Chain Monte Carlo (MCMC) and nested sampling algorithms [ 10 , 11 , 12 ] —have become computationally prohibitive for large datasets like the NANOGrav 15-year release (NG15), especially when extensive model comparison is required. To address this challenge, we build on recent developments in machine learning by implementing a normalizing flow (NF)-based Bayesian inference pipeline [ 13 , 14 , 15 ] . Our architecture is trained on forward-simulated pulsar timing residuals for multiple SGWB+noise models, including realistic HD correlations and red noise components (see Appendix B for the workflow of our training). The NF model maps between the parameter space and a uniform latent distribution via invertible autoregressive flows, enabling efficient posterior reconstruction for each model. Crucially, we show that this framework not only replicates MCMC-level accuracy for parameter inference, but also enables direct estimation of model evidence through a learned harmonic mean estimator (HME) [ 16 , 17 , 18 ] . Applied to 10-pulsar subsets of NG15 data, our pipeline yields robust posterior distributions and Bayes factors for ten SGWB source models, including variations of dual inflationary/bouncing universe scenarios. Compared to traditional inference workflows MCMC (68 pulsars), our method reduces runtime from \sim 10 days to \sim 20 hours (10 pulsars) (see Sec. VI for more detailed discussion on the scalability trend, and see Appendix F for comparative timing of NF and MCMC methods), while maintaining physical interpretability and consistency with MCMC benchmarks (Hellinger distances \lesssim 0.3 ). Our results demonstrate that NF-based model comparison is a powerful and scalable tool for PTA-era gravitational-wave cosmology. This framework is well-suited for upcoming large-scale datasets from SKA and next-generation PTAs, opening new avenues for rapid inference across the full landscape of SGWB source hypotheses. II Extracting the SGWB Power Spectrum from Pulsar Timing Residuals Following standard pulsar timing array (PTA) conventions, each pulsar’s timing residuals can be decomposed into white noise, intrinsic red noise, and a stochastic gravitational-wave background (SGWB) contribution: r_{I}(t)=r_{I}^{\mathrm{WN}}(t)+r_{I}^{\mathrm{RN}}(t)+r_{I}^{\mathrm{SGWB}}(t), (1) where I=1,\dots,N_{\mathrm{pulsars}} labels the I -th pulsar and N_{\mathrm{pulsars}} is the total number of pulsars. In this work, from the NANOGrav 15-year (NG15) dataset [ 19 ] , we select ten pulsars previously identified as key contributors to SGWB detection sensitivity following [ 20 , 13 ] , N_{\mathrm{pulsars}}=10 . The white noise residuals of these pulsars satisfy r_{I}^{\text{WN}}(t)\sim\mathcal{N}(0,\sigma_{I}^{2}) , with \sigma_{I}^{2} given at the Table 5 in Appendix A . A discrete Fourier transform [ 13 ] approximates these timing residuals as r_{I}(t)\approx r_{I}^{\text{WN}}(t)+\sum_{k=0}^{N_{f}-1}\Delta f\left[a_{I}(f_{k})\cos(2\pi f_{k}t)+b_{I}(f_{k})\sin(2\pi f_{k}t)\right], (2) with \langle a_{I}(f)b_{J}(f^{\prime})\rangle=0 , \langle a_{I}(f)a_{J}(f^{\prime})\rangle=\langle b_{I}(f)b_{J}(f^{\prime})\rangle=S_{IJ}(f)\,\delta(f-f^{\prime}), (3) and both a_{I} and b_{I} are drawn from the Gaussian distributions, where the red noise r_{I}^{\mathrm{RN}}(t) and SGWB r_{I}^{\mathrm{SGWB}}(t) are captured by a single power spectral density (PSD) matrix, S_{IJ}(f)=S_{IJ}^{\text{RN}}(f)+S_{IJ}^{\text{SGWB}}(f). (4) Here, f_{k}=f_{L}+k\,\Delta f , f_{L}=\Delta f=1/T_{\text{obs}} , and T_{\text{obs}}\approx 15.8\,\mathrm{yr} for NANOGrav’s 15-year data, with N_{f}=14 frequency bins. The PSD matrix includes pulsar-specific red noise (diagonal entries), S_{\mathrm{RN},IJ}^{(I)}(f)=\frac{A_{\mathrm{RN}}^{(I)2}}{12\pi^{2}}\left(\frac{f}{f_{\mathrm{yr}}}\right)^{-\gamma_{\mathrm{RN}}^{(I)}}f_{\mathrm{yr}}^{-3}\,\delta_{IJ}, (5) and an SGWB term reflecting inter-pulsar correlations (off-diagonal entries), S_{\text{SGWB},IJ}(f)=\frac{1}{12\pi^{2}f^{5}}\,\frac{3H_{100}^{2}}{2\pi^{2}}\,\Omega_{\text{GW}}(f)\,h^{2}\,\Gamma_{IJ}, (6) where A_{\mathrm{RN}}^{(I)} and \gamma_{\mathrm{RN}}^{(I)} are red noise parameters, f_{\mathrm{yr}}=1\,\mathrm{yr}^{-1} , H_{100}=100\,\mathrm{km\,s}^{-1}\,\mathrm{Mpc}^{-1} , and h\approx 0.7 . The SGWB correlations are captured by the Hellings-Downs matrix \Gamma_{IJ} , which depends on angular separations \zeta_{IJ} between pulsars [ 6 , 7 ] : \displaystyle\Gamma_{IJ}=\frac{3}{2}\biggl[\frac{1+\cos\zeta_{IJ}}{2}\ln\!\left(\!\frac{1+\cos\zeta_{IJ}}{2}\right)-\,\frac{1-\cos\zeta_{IJ}}{2}\ln\!\left(\!\frac{1-\cos\zeta_{IJ}}{2}\right)\biggr]-\frac{1-\cos\zeta_{IJ}}{4}+\frac{1}{2}, (7) with \zeta_{IJ} computed via ENTERPRISE . By fitting the red noise and SGWB parameters through Bayesian inference—using either Markov Chain Monte Carlo or normalizing-flow methods—one can extract the best-fit spectral shape and amplitude of the SGWB. More specifically, once a posterior distribution over the relevant noise and SGWB parameters is obtained, the reconstructed power spectrum can be visualized by plotting \Omega_{\mathrm{GW}}(f) at each posterior sample or by constructing a posterior predictive distribution. Such a reconstruction provides direct insight into the amplitude and spectral shape of the SGWB, thus illuminating its physical origin. III Trainning Normalizing-Flow architecture III.1 Normalizing Flow Model Construction and Training Process Training NF architectures aims to optimize the probability density p_{\phi}(\tilde{\theta}_{Di}^{(j)}\mid\tilde{\mathbf{x}}_{i}^{(j)},\mathcal{H}^{(j)}) for simulated parameter vectors \tilde{\theta}=\{\tilde{\theta}_{Di}^{(j)}\} under the physical model \mathcal{H}=\{\mathcal{H}^{(j)}\} (encompassing both noise and SGWB). Here, \tilde{\mathbf{x}}=\{\tilde{\mathbf{x}}_{i}^{(j)}\} denotes the simulated timing residuals, with i=1,\dots,2\times 10^{5} (the size of the training set), j=1,\dots,10 (the number of SGWB models in this study), D=22 (the dimensionality of each SGWB+noise parameter set, comprising 20 noise parameters ( 2N_{\mathrm{pulsars}} ) plus 2 SGWB parameters), \phi denotes the weight parameters of this NF-based machine learning model (the weight parameter file is saved after each training iteration, and posterior sampling is performed using this file along with the model script after convergence, \phi\rightarrow\phi_{\mathrm{best}} .). The workflow of the NF-based machine learning pipeline for SGWB analysis in this study is illustrated in Fig. 11 of Appendix B , which outlines data extraction from the NG15 dataset, generation of simulated dataset, NF model training, posterior inference of observational data, Bayes factors computation and SGWB model comparisons. In NF-based ML, p_{\phi}(\tilde{\theta}_{Di}^{(j)}\mid\tilde{\mathbf{x}}_{i}^{(j)},\mathcal{H}^{(j)}) is mapped from a uniform base distribution p_{\mathrm{base}}(\tilde{\textbf{z}}_{Di}^{(j)})=\text{Uniform}[-1,1] (as we