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

Bugfix/issue 1179 exponential lower bound check #1469

Merged
merged 8 commits into from
Jun 5, 2015
1 change: 1 addition & 0 deletions src/stan/math/prim/scal/prob/exponential_log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ namespace stan {

T_partials_return logp(0.0);
check_not_nan(function, "Random variable", y);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this check -- it's covered by check_nonnegative

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

check_nonnegative(function, "Random variable", y);
check_positive_finite(function, "Inverse scale parameter", beta);
check_consistent_sizes(function,
"Random variable", y,
Expand Down
2 changes: 2 additions & 0 deletions src/test/prob/exponential/exponential_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class AgradDistributionsExponential : public AgradDistributionTest {
void invalid_values(vector<size_t>& index,
vector<double>& value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test on the boundary where y = 0.

// y
index.push_back(0U);
value.push_back(-10.0);

// beta
index.push_back(1U);
Expand Down