nbi: the Astronomer's Package for Neural Posterior Estimation (2312.03824v2)
Abstract: Despite the promise of Neural Posterior Estimation (NPE) methods in astronomy, the adaptation of NPE into the routine inference workflow has been slow. We identify three critical issues: the need for custom featurizer networks tailored to the observed data, the inference inexactness, and the under-specification of physical forward models. To address the first two issues, we introduce a new framework and open-source software nbi (Neural Bayesian Inference), which supports both amortized and sequential NPE. First, nbi provides built-in "featurizer" networks with demonstrated efficacy on sequential data, such as light curve and spectra, thus obviating the need for this customization on the user end. Second, we introduce a modified algorithm SNPE-IS, which facilities asymptotically exact inference by using the surrogate posterior under NPE only as a proposal distribution for importance sampling. These features allow nbi to be applied off-the-shelf to astronomical inference problems involving light curves and spectra. We discuss how nbi may serve as an effective alternative to existing methods such as Nested Sampling. Our package is at https://github.com/kmzzhang/nbi.
- Approximate Bayesian Computation for astronomical model analysis: a case study in galaxy demographics and morphological transformation at high redshift. Monthly Notices of the Royal Astronomical Society, 425(1):44–65, September 2012. ISSN 0035-8711. doi: 10.1111/j.1365-2966.2012.21371.x. URL https://doi.org/10.1111/j.1365-2966.2012.21371.x.
- Real-Time Gravitational Wave Science with Neural Posterior Estimation. Physical Review Letters, 127(24):241103, December 2021. doi: 10.1103/PhysRevLett.127.241103. URL https://link.aps.org/doi/10.1103/PhysRevLett.127.241103. Publisher: American Physical Society.
- Automatic Posterior Transformation for Likelihood-Free Inference. In Proceedings of the 36th International Conference on Machine Learning, pp. 2404–2414. PMLR, May 2019. URL https://proceedings.mlr.press/v97/greenberg19a.html. ISSN: 2640-3498.
- Accelerated Bayesian SED Modeling Using Amortized Neural Posterior Estimation. The Astrophysical Journal, 938(1):11, October 2022. ISSN 0004-637X. doi: 10.3847/1538-4357/ac7b84. URL https://dx.doi.org/10.3847/1538-4357/ac7b84. Publisher: The American Astronomical Society.
- Approximate Bayesian computation in large-scale structure: constraining the galaxy–halo connection. Monthly Notices of the Royal Astronomical Society, 469(3):2791–2805, August 2017. ISSN 0035-8711. doi: 10.1093/mnras/stx894. URL https://doi.org/10.1093/mnras/stx894.
- Improving the Accuracy of Planet Occurrence Rates from Kepler Using Approximate Bayesian Computation. The Astronomical Journal, 155(5):205, April 2018. ISSN 1538-3881. doi: 10.3847/1538-3881/aab9a8. URL https://dx.doi.org/10.3847/1538-3881/aab9a8. Publisher: The American Astronomical Society.
- Accelerating astronomical and cosmological inference with preconditioned monte carlo. Monthly Notices of the Royal Astronomical Society, 516(2):1644–1653, 2022.
- DIGS: deep inference of galaxy spectra with neural posterior estimation. Machine Learning: Science and Technology, 3(4):04LT04, December 2022. ISSN 2632-2153. doi: 10.1088/2632-2153/ac98f4. URL https://dx.doi.org/10.1088/2632-2153/ac98f4. Publisher: IOP Publishing.
- Masked autoregressive flow for density estimation. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, pp. 2335–2344, Red Hook, NY, USA, December 2017. Curran Associates Inc. ISBN 978-1-5108-6096-4.
- sbi: A toolkit for simulation-based inference. Journal of Open Source Software, 5(52):2505, August 2020. ISSN 2475-9066. doi: 10.21105/joss.02505. URL https://joss.theoj.org/papers/10.21105/joss.02505.
- Neural posterior estimation for exoplanetary atmospheric retrieval. Astronomy & Astrophysics, 672:A147, April 2023. ISSN 0004-6361, 1432-0746. doi: 10.1051/0004-6361/202245263. URL https://www.aanda.org/articles/aa/abs/2023/04/aa45263-22/aa45263-22.html. Publisher: EDP Sciences.
- SBI++: Flexible, Ultra-fast Likelihood-free Inference Customized for Astronomical Application, April 2023. URL http://arxiv.org/abs/2304.05281. arXiv:2304.05281 [astro-ph].
- LIKELIHOOD-FREE COSMOLOGICAL INFERENCE WITH TYPE Ia SUPERNOVAE: APPROXIMATE BAYESIAN COMPUTATION FOR A COMPLETE TREATMENT OF UNCERTAINTY. The Astrophysical Journal, 764(2):116, January 2013. ISSN 0004-637X. doi: 10.1088/0004-637X/764/2/116. URL https://dx.doi.org/10.1088/0004-637X/764/2/116. Publisher: The American Astronomical Society.
- Real-time Likelihood-free Inference of Roman Binary Microlensing Events with Amortized Neural Posterior Estimation. The Astronomical Journal, 161(6):262, May 2021. ISSN 1538-3881. doi: 10.3847/1538-3881/abf42e. URL https://dx.doi.org/10.3847/1538-3881/abf42e. Publisher: The American Astronomical Society.