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

Add rejection sampling capability #16

Open
sdl1 opened this issue Sep 27, 2021 · 0 comments
Open

Add rejection sampling capability #16

sdl1 opened this issue Sep 27, 2021 · 0 comments

Comments

@sdl1
Copy link
Member

sdl1 commented Sep 27, 2021

It would be useful to be able to select the seed for (e.g.) the RandomSelector based on user-specified criteria. This would allow an implementation of more sophisticated sampling methods (cf. #7 ) via rejection sampling, with a compact representation (the seed) of the final date set. Something like the following:

function acceptance(validation_dates, holdout_dates)
    # We want 1st of January to be in the validation dates
    return DateTime(2021, 1, 1) in validation_dates
end

# Gives a seed with the desired properties to use with RandomSelector
seed = rejection_sample(RandomSelector, date_range, acceptance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant