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

Pass on random generator to KDE resample method #436

Merged
merged 1 commit into from Sep 20, 2022

Conversation

hendriko373
Copy link
Contributor

@hendriko373 hendriko373 commented Sep 13, 2022

Currently, the random generator in the get_proposal method for the KDEMove is not used when taking samples from the KDE. This is problematic since we cannot run emcee in a reproducible way. This PR fixes this by passing on the random generator to the KDE resampling method, so that sampling is reproducible.

Use the random generator available in the KDE propose method for
resampling, in order to have reproducible emcee runs.
@hendriko373
Copy link
Contributor Author

The test test_longdouble_actually_needed sometimes fails: the condition

assert np.abs(np.mean(samples) - mjd) < 10 * sigma / np.sqrt(len(samples))

fails for certain np.random states.

What is the preferred way to solve this?

  • Seeding the random generator?
  • Relaxing the condition?
  • ...

@dfm dfm merged commit b206ebd into dfm:main Sep 20, 2022
@dfm
Copy link
Owner

dfm commented Sep 20, 2022

Thanks!

@hendriko373 hendriko373 deleted the feature/kde-random branch September 20, 2022 13:40
@hendriko373
Copy link
Contributor Author

You're welcome.

Would it be possible to get a new version released including this fix?

@dfm
Copy link
Owner

dfm commented Sep 21, 2022

I'm going to wait until we get that test failure figured out (#438) then definitely!

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

Successfully merging this pull request may close these issues.

None yet

2 participants