Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Inverse transform sampling accuracy warning #472

Merged
merged 2 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions skypy/galaxies/redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ def redshifts_from_comoving_density(redshift, density, sky_area, cosmology, nois
Sampled redshifts such that the comoving number density of galaxies
corresponds to the input distribution.

Warnings
--------
The inverse cumulative distribution function is approximated from the
number density and comoving volume calculated at the given `redshift`
values. The user must choose suitable `redshift` values to satisfy their
desired numerical accuracy.

'''

# redshift number density
Expand Down
7 changes: 7 additions & 0 deletions skypy/utils/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ def schechter(alpha, x_min, x_max, resolution=100, size=None, scale=1.):
x_sample : array_like
Samples drawn from the Schechter function.

Warnings
--------
The inverse cumulative distribution function is approximated from the
Schechter function evaluated on a logarithmically-spaced grid. The user
must choose the `resolution` of this grid to satisfy their desired
numerical accuracy.

References
----------
.. [1] https://en.wikipedia.org/wiki/Luminosity_function_(astronomy)
Expand Down