alashworth / test-issue-import

0 stars 0 forks source link

Add ability to randomly generate integers from discrete uniform #179

Open alashworth opened 5 years ago

alashworth commented 5 years ago

Issue by lcomm Thursday Jan 11, 2018 at 22:54 GMT Originally opened as https://github.com/stan-dev/stan/issues/2457


Summary:

For contexts like bootstrapping, it would be helpful to be able to sample uniformly from the set of integers 1, ..., N. Because the ceil() function does not return an integer, we cannot do ceil(uniform_rng(0, N)).

Description:

The ideal function would take inputs of minInteger and maxInteger. The return type would be an integer between minInteger and maxInteger, inclusive. All possible return values would arise with the same probability.

Reproducible Steps:

N/A

Current Output:

N/A

Expected Output:

N/A

Additional Information:

N/A

Current Version:

v2.17.1