A Short Research Note on Calculating Exact Distribution Functions and Random Sampling for the 3D NFW Profile
Abstract
In this short note we publish the analytic quantile function for the Navarro, Frenk & White (NFW) profile. All known published and coded methods for sampling from the 3D NFW PDF use either accept-reject, or numeric interpolation (sometimes via a lookup table) for projecting random Uniform samples through the quantile distribution function to produce samples of the radius. This is a common requirement in N-body initial condition (IC), halo occupation distribution (HOD), and semi-analytic modelling (SAM) work for correctly assigning particles or galaxies to positions given an assumed concentration for the NFW profile. Using this analytic description allows for much faster and cleaner code to solve a common numeric problem in modern astronomy. We release R and Python versions of simple code that achieves this sampling, which we note is trivial to reproduce in any modern programming language.
- Publication:
-
Research Notes of the American Astronomical Society
- Pub Date:
- June 2018
- DOI:
- 10.3847/2515-5172/aacc70
- arXiv:
- arXiv:1805.09550
- Bibcode:
- 2018RNAAS...2...55R
- Keywords:
-
- Astrophysics - Cosmology and Nongalactic Astrophysics
- E-Print:
- 3 pages, 1 figure. R and Python versions of the code can be found at https://github.com/asgr/NFWdist and https://github.com/CullanHowlett/NFWdist respectively