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

truncation out-of-bounds in model should throw #2053

Open
1 task
bob-carpenter opened this issue Sep 3, 2016 · 0 comments
Open
1 task

truncation out-of-bounds in model should throw #2053

bob-carpenter opened this issue Sep 3, 2016 · 0 comments
Assignees
Milestone

Comments

@bob-carpenter
Copy link
Contributor

bob-carpenter commented Sep 3, 2016

Summary:

As pointed out by @bgoodri on stan-dev list, truncation syntax is generating

        if (y < 1) lp_accum__.add(-std::numeric_limits<double>::infinity());
        else lp_accum__.add(-poisson_ccdf_log(1, rate));

Instead it should be throwing std::domain_error with a meaningful message.

Also from @bgoodri:

For

y ~ normal(mu, sigma) T[1,];

then if y < 1, then I think it should exit but if y == 1, then it should throw an non-fatal exception. It is possible that the user wrote

parameters {
  real<lower=1> y;
  ...
}

and y just underflows to 1.

  • fix by generating call to appropriate err functions in stan::math with appropriate bounds

Reproducible Steps:

Use truncation with out of bounds.

Current Output:

Nothing---just keeps going and get failure due to -infinity log density.

Expected Output:

Appropriate warning message.

Current Version:

v2.11.0

@bob-carpenter bob-carpenter added this to the v2.12.0++ milestone Sep 3, 2016
@bob-carpenter bob-carpenter self-assigned this Sep 3, 2016
@syclik syclik modified the milestones: v2.13.0, 2.13.0++ Oct 22, 2016
@syclik syclik modified the milestones: v2.13.1, v2.13.1++ Dec 3, 2016
@syclik syclik modified the milestones: v2.13.2, v2.13.2++ Dec 26, 2016
@bob-carpenter bob-carpenter modified the milestones: 2.15.0++, v2.14.0++ Mar 30, 2017
@seantalts seantalts modified the milestones: 2.16.0, 2.17 Jul 5, 2017
@seantalts seantalts modified the milestones: 2.17.0, 2.17.0++ Sep 6, 2017
@seantalts seantalts modified the milestones: 2.18.0, 2.18.0++ Jul 13, 2018
@mitzimorris mitzimorris modified the milestones: 2.18.1, 2.18.1++ Dec 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants