-
Notifications
You must be signed in to change notification settings - Fork 13
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
Uninformative Error Message when Sample Size is 1 #67
Comments
The problem is that the Turing model has an error; it is using However, Rewriting the Turing model like this should fix the problem:
|
(Don't worry, this is a very common mistake -- common enough that I should probably add an explanation when the model has a sample size of 1 😄) |
psis_loo()
does not behave as expected when given a Turing model
Thanks for the quick response and the fix, @ParadaCarleton. I understand the source of the problem now. This is my first time encountering the I'm not sure I would say that model has an error, however. Using the In any case, I can see how using |
And yes, changing |
I believe @torfjelde commented on this by saying:
Broadcasting ( That being said, I'm working on a PR that will fix this by creating syntax that lets users unambiguously specify what they mean by an independent observation. |
I am encountering an issue where if I pass a Turing model of type
DynamicPPL.Model
topsis_loo()
it returns values of-Inf
orNaN
.However, when I pass it a log-likelihood function and the data as an array of tuples, it behaves "correctly" (in the sense that it returns finite values, but I have not independently verified that they are accurate).
The following is a reproducible example.
Now, reading through the code in
src/TuringHelpers.jl
in this repo, it seems as though there's a method that supports Turing models directly. However, if I runpsis_loo(model, post)
then I get
Instead, I can define the appropriate log-likelihood function and provide the data in an array of tuples:
And this yields something that seems correct.
I would expect these two approaches to yield the same result.
Am I simply using
psis_loo()
incorrectly when passing it a Turing model of typeDynamicPPL.Model
? The language thatResults of PSIS-LOO-CV with 10000 Monte Carlo samples and 1 data points
seems to suggest that it does not recognize thatmodel
contains multiple data points.For now I will continue to use the
ll_fun
approach, but wanted to call this out here in case there is something that needs a closer look inTuringHelpers.jl
.The text was updated successfully, but these errors were encountered: