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

Added distribution_matching_indices function #795

merged 2 commits into from Aug 24, 2017


None yet
2 participants
Copy link

aphearin commented Aug 14, 2017

The utils.distribution_matching_indices function allows you to resample an input distribution (with replacement) so that it matches a desired output distribution. This is useful, for example, when comparing the properties of two galaxy samples with matching stellar mass functions. Visual demonstration shown in the figure below, which is also included in the docs.

@eteq - do you know whether this function already appears in Astropy?


@aphearin aphearin added this to the v0.6 milestone Aug 14, 2017

@aphearin aphearin self-assigned this Aug 14, 2017

@aphearin aphearin force-pushed the aphearin:distribution_matching branch from c263410 to e99251d Aug 23, 2017

@aphearin aphearin merged commit 4a26a25 into astropy:master Aug 24, 2017

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
continuous-integration/travis-ci/pr The Travis CI build is in progress

@aphearin aphearin deleted the aphearin:distribution_matching branch Aug 24, 2017


This comment has been minimized.

Copy link

eteq commented Aug 25, 2017

@aphearin - definitely does not. I think it definitely could make sense in astropy.stats, though, so I'd encourage trying there.

You might get some pushback along the lines of "maybe this should go in scipy.stats". I have a suspicion it wouldn't make it in there (not clear that it's really what scipy.stats is about), but worth thinking a bit about. To me this is a fairly astro-common application that I don't see often elsewhere, so I think it's fair to include... But others might disagree.


This comment has been minimized.

Copy link
Contributor Author

aphearin commented Aug 25, 2017

Ok, sounds good. This should be easy enough to port over to astropy.stats since the module is standalone. Thanks for pointing me to the right place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment