-
-
Notifications
You must be signed in to change notification settings - Fork 60
Fix: importance_sampling=None produces error #427
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
Conversation
… "none" or None - Moved importance sampling logic from `multipath_pathfinder` to `fit_pathfinder` to fix error method is "none" or None - Update docstrings to clarify importance sampling method behavior - Use match statement for method selection in importance_sampling
- Test different importance sampling approaches (psis, psir, identity, None)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just one question.
|
||
if importance_sampling is not None: | ||
importance_sampling = importance_sampling.lower() | ||
importance_sampling = None if importance_sampling == "none" else importance_sampling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you had globally removed the use of "none"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I thought about allowing a string for None
as "none"
to keep it consistent with the other importance_sampling
options (i.e., "psis"
, "psir"
, "identity"
). Come to think of it, None
would be consistent with Python APIs in general with mixed argument types (str | None
, int | None
, etc).
I'll send another commit to remove the use of "none".
Is this good to merge? |
Yes I believe so. @fonnesbeck ? |
I just went ahead and merged this. Thanks @aphc14 ! |
Thanks @zaxtax ! |
Fix handling of
importance_sampling="none"
orNone
optionChanges
"none"
andNone
consistentlyAdded/Modified Tests
(num_paths, num_draws_per_path, N)
(whereN
are the number of model parameters)(num_draws, N)
np.testing.assert_allclose
tolerance as increasingjitter
brings parameter estimates closer to the reference value