-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Randomisation for loo_pit of discrete data. #121
Randomisation for loo_pit of discrete data. #121
Conversation
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.
Thanks @TeemuSailynoja! Just a few minor comments.
Also, can you save the new RDS files using |
…nce data save format.
…domisation and comment about fixing random seed.
Thank you, @jgabry. I hope to have addressed all the requested changes and additions in the last commits. |
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.
Thanks @TeemuSailynoja, this looks good!
@andrjohns The StanFunctions Support checks are failing due to a compilation issue with the lgpr package, but that must be unrelated to this PR (this PR doesn't touch anything relevant for that), so I will go ahead and merge and we can sort out whatever is causing those failures before we do a release. |
Ah yeah, unrelated to this PR. Upstream changed the type of the RNG used in Stan, so we need to update to match |
Fixes issue #22
I added randomisation to the loo_pit function so that it can be used for discrete data too.
Essentially, when computing pit, we check if the posterior sample contains an exact match to the observation.
In the case an exact match is found, the pit is randomised.
I also added a check that the log weights are finite and not NULL, as well as a warning, if the loo_pit values contain values greater than 1, which can happen with non-normalized weights.