A Short Research Note on Calculating Exact Distribution Functions and Random Sampling for the 3D NFW Profile
A. S. G. Robotham, Cullan Howlett

TL;DR
This paper provides an analytic quantile function for the NFW profile, enabling faster and more accurate sampling of particle positions in astrophysical simulations, improving efficiency in modeling galaxy distributions.
Contribution
It introduces an exact analytic quantile function for the 3D NFW profile, replacing approximate methods for sampling in astrophysical modeling.
Findings
Analytic quantile function for NFW profile provided
Code implementations in R and Python released
Sampling process significantly faster and more accurate
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
