-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Need error messages for various truncation situations #22
Comments
model { 1 ~ bernoulli(0.2) T[0, 1]; }
, namely
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
No matches for:
real ~ bernoulli_cdf(real)
Which parser/version is generating the above message?
In Stan 2.18, this model parses fine as it should.
The "1" should be parsed as an integer, not a real.
|
Those error messages are coming from Stan on |
Oh, I made a mistake when I first wrote the post and edited it in github and I see that you replied to the old post. Try |
That error message is technically correct. But it is confusing because the call to the CDF is implicit in the truncation. The message should say that.
Truncation adds terms for the cdf to normalize.
For Bernoulli, they have to be integer truncation bounds because the outcomes are integers.
… On Dec 18, 2018, at 3:55 PM, seantalts ***@***.***> wrote:
Oh, I made a mistake when I first wrote the post and edited it in github and I see that you replied to the old post. Try
model { 1 ~ bernoulli(0.2) T[0.1, 1.1]; }
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Right. The following does compile, on stanc2:
So the problem was merely the signature of the bounds. I think stanc3 currently does check the existence of a cdf, but I don't think it checks the type of the cdf. I hadn't realised that the bounds can sometimes be integer and that that needs to be checked. Therefore, it was not throwing an error. By the way, the following also compiles on stanc2, which shouldn't, so that's a bug:
|
This should be fixed now. Definitely was a bug. |
In the current compiler, this model throws a couple of errors we aren't throwing:
, namely
that first error message might be spurious given that 1 could also be an int.
The text was updated successfully, but these errors were encountered: