{"action":"created","issue":{"url":"https://api.github.com/repos/stan-dev/math/issues/913","repository_url":"https://api.github.com/repos/stan-dev/math","labels_url":"https://api.github.com/repos/stan-dev/math/issues/913/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/math/issues/913/comments","events_url":"https://api.github.com/repos/stan-dev/math/issues/913/events","html_url":"https://github.com/stan-dev/math/pull/913","id":334988653,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2ODIxODAx","number":913,"title":"Feature/integrate 1d boost","user":{"login":"bbbales2","id":4742424,"node_id":"MDQ6VXNlcjQ3NDI0MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4742424?v=4","gravatar_id":"","url":"https://api.github.com/users/bbbales2","html_url":"https://github.com/bbbales2","followers_url":"https://api.github.com/users/bbbales2/followers","following_url":"https://api.github.com/users/bbbales2/following{/other_user}","gists_url":"https://api.github.com/users/bbbales2/gists{/gist_id}","starred_url":"https://api.github.com/users/bbbales2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbbales2/subscriptions","organizations_url":"https://api.github.com/users/bbbales2/orgs","repos_url":"https://api.github.com/users/bbbales2/repos","events_url":"https://api.github.com/users/bbbales2/events{/privacy}","received_events_url":"https://api.github.com/users/bbbales2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":35,"created_at":"2018-06-22T19:11:29Z","updated_at":"2018-07-04T07:45:55Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/stan-dev/math/pulls/913","html_url":"https://github.com/stan-dev/math/pull/913","diff_url":"https://github.com/stan-dev/math/pull/913.diff","patch_url":"https://github.com/stan-dev/math/pull/913.patch"},"body":"#### Submission Checklist\r\n\r\n- [x] Run unit tests: `./runTests.py test/unit`\r\n- [x] Run cpplint: `make cpplint`\r\n- [x] Declare copyright holder and open-source license: see below\r\n\r\n#### Summary:\r\n\r\nThis pull req. switches to the Boost 1D integrator and addresses a bunch of the interface issues brought up here: https://github.com/stan-dev/math/pull/759\r\n\r\nNotes:\r\n1. Boost integrators are here\r\n\r\n2. Boost integrators use a different definition of tolerance than the previous integrator\r\n\r\n3. Limits at infinity are technically included, but it's very easy for autodiff to fail. The integrators will evaluate the functions near or at the numeric_limits, so numbers quickly become infs and math with infs turns into NaNs. Integrating a normal pdf from negative to positive infinity with a standard deviation that's a parameter won't work for instance (if the standard deviation is fixed it's fine -- the problem is in the integral of the automatically differentiated function)\r\n\r\nBased on this I'm not sure if we should do limits at infinity. The autodiff is definitely going to cause bunches of issues here. Thoughts?\r\n\r\n4. I did not end up doing the two argument function. Two things:\r\n  a. Boost recommends splitting integrals that cross zero into two. That's easy to automate, and so I did it. That means that xc can be a distance two up to three different points now, so it's a little weirder to work with.\r\n  b. I think it's easy enough to replicate the behavior by either hard coding things in or passing them in as data (x_r)\r\n\r\nAnything I'm missing here?\r\n\r\n5. The limits of integration cannot be vars in this integration.\r\n\r\n@bgoodri can you review this? The easiest place to start will be stan/math/rev/arr/functor/integrate_1d.hpp\r\n\r\n#### Intended Effect:\r\n\r\nSwitch to Boost for 1d integration and allow infinite integrals.\r\n\r\n#### How to Verify:\r\n\r\n./runTests.py test/unit/math/prim/arr/functor/integrate_1d_test.cpp\r\n./runTests.py test/unit/math/rev/arr/functor/integrate_1d_test.cpp\r\n\r\n#### Side Effects:\r\n\r\nChanged interpretation of tolerance for 1d integration. Removed ability to pass in custom gradient functions\r\n\r\n#### Documentation:\r\n\r\nIn the doxygen!\r\n\r\n#### Copyright and Licensing\r\n\r\nPlease list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Columbia University\r\n\r\nBy submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:\r\n- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)\r\n- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)\r\n"},"comment":{"url":"https://api.github.com/repos/stan-dev/math/issues/comments/402393474","html_url":"https://github.com/stan-dev/math/pull/913#issuecomment-402393474","issue_url":"https://api.github.com/repos/stan-dev/math/issues/913","id":402393474,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjM5MzQ3NA==","user":{"login":"bgoodri","id":3386282,"node_id":"MDQ6VXNlcjMzODYyODI=","avatar_url":"https://avatars2.githubusercontent.com/u/3386282?v=4","gravatar_id":"","url":"https://api.github.com/users/bgoodri","html_url":"https://github.com/bgoodri","followers_url":"https://api.github.com/users/bgoodri/followers","following_url":"https://api.github.com/users/bgoodri/following{/other_user}","gists_url":"https://api.github.com/users/bgoodri/gists{/gist_id}","starred_url":"https://api.github.com/users/bgoodri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgoodri/subscriptions","organizations_url":"https://api.github.com/users/bgoodri/orgs","repos_url":"https://api.github.com/users/bgoodri/repos","events_url":"https://api.github.com/users/bgoodri/events{/privacy}","received_events_url":"https://api.github.com/users/bgoodri/received_events","type":"User","site_admin":false},"created_at":"2018-07-04T07:45:54Z","updated_at":"2018-07-04T07:45:54Z","author_association":"CONTRIBUTOR","body":"I think the problem is with\r\n\r\nhttps://github.com/stan-dev/math/pull/913/files#diff-e357c4b0c3d192168d5fbc2487103b31R111\r\n\r\nwhere it does `value_of(theta)`. If you then call one of the functions in `stan/math/prim/scal/prob` that does not calculate the derivatives when its arguments are not vars, then I can see why they would be nan. If so, that is a serious problem, but I am not sure how to fix it. "}}
{"actor":{"display_login":"bgoodri"}}