Skip to content

Feature/issue 2966 add 7 parameter ddm cdf and ccdf #3042

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

Open
wants to merge 78 commits into
base: develop
Choose a base branch
from

Conversation

Franzi2114
Copy link
Collaborator

@Franzi2114 Franzi2114 commented Mar 29, 2024

Summary

With this PR the CDF and the CCDF of the 7-parameter diffuion model are added.
See issue #2966
Relates to issue #2822

Tests

We implemented analogous tests as for the PDF

Side Effects

no

Release notes

CDF and CCDF for the 7-parameter diffusion model. Allows modeling truncated and censored data.

Checklist

  • Copyright holder: Franziska Henrich, Christoph Klauer

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@Franzi2114 Franzi2114 requested a review from SteveBronder March 29, 2024 18:41
@SteveBronder
Copy link
Collaborator

SteveBronder commented Oct 7, 2024

tbc what I made a branch to show what I did

git pull
git checkout wiener_lpdf/test-vals
## These tests pass
python3 ./runTests.py -j20 ./test/unit/math/mix/prob/ -f wiener_full_lcdf
## Some of these tests fail
python3 ./runTests.py -j20 ./test/unit/math/prim/prob/ -f wiener_full_lc

@Franzi2114
Copy link
Collaborator Author

Only your suggested changes above for wiener4_lccdf yielded errors. The changes I made in wiener4_lcdf are all fine.

I changed the lines in winer4_lccdf to the following three lines:

  const auto exponent = -sign(v) * 2.0 * v * a * w;
  auto prob_grad_w = (v != 0) ? exp(LOG_TWO + log(fabs(v)) + log(a) - log1m_exp(exponent)) : ret_t(1 / w);
  prob_grad_w = (v > 0) ? prob_grad_w * exp(exponent) : prob_grad_w;

Now, all tests should pass. Let's see. Then, you can say, what I shall change next.

@stan-buildbot

This comment was marked as outdated.

@Franzi2114
Copy link
Collaborator Author

Hey Steve, now the errors from before should be fixed and the wildcards are deleted. What next?

@stan-buildbot

This comment was marked as off-topic.

@Franzi2114
Copy link
Collaborator Author

Hey @SteveBronder, any news?

@Franzi2114
Copy link
Collaborator Author

Hello together, I would kindly like to ask, how we can proceed with this PR?

@Franzi2114
Copy link
Collaborator Author

Hey @SteveBronder, any news on this PR?

@Franzi2114
Copy link
Collaborator Author

Dear @SteveBronder, @andrjohns, @bob-carpenter,

I would kindly like to ask whether it would be possible to continue this PR?

@bob-carpenter
Copy link
Member

I'm sorry this got hung up without a response. There's no excuse for us leaving PRs hanging. If they're impossible or too much work, we need to make that clear earlier rather than later.

In the future, please feel free to email me about this kind of thing and I can talk to our devs and try to figure out what's going on: bcarpenter@flatironinstitute.org

@SteveBronder
Copy link
Collaborator

Hey! I'm terribly sorry. We've been doing a bunch of stuff to get laplace working in Stan and I kind of got tunnel vision. Honestly I felt like some of the math and robustness checks were above my paygrade so I pinged @andrjohns or @bob-carpenter to have a look at some things here. I'm not totally sure how to continue because I don't think I'm the right reviewer for this at this point

@bob-carpenter
Copy link
Member

The C++ in Stan is way too complicated for me, which I find sad because I wrote around half of the first release (@syclik wrote most of the rest). I'm also not enough of a statistician or applied mathematician to even understand what this function is supposed to be doing.

The only two candidates among active Stan developers would be:

Though he didn't come out and say this directly, I think you should interpret @SteveBronder's message above as saying he is not going to do it. I don't know how much time @andrjohns has to work on Stan these days. We can see if he responds. Our other C++ developers have all departed for industry.

I wish I could help myself, but I gave up trying to understand or code Stan's C++ code years ago when I couldn't finish a simple PR of my own. I think we've dug ourselves into a deep hole of complexity and I don't see any way out of it other than starting over. I've personally moved to developing samplers outside the context of Stan because integrating anything with Stan is such a headache these days.

I feel terrible that we left you hanging for so long, but I can't think of a way we can review this. In retrospect, we should've realized this was going to be too complex for us due to the form of the density (none of our testing is set up for this many arguments) and the lack of understanding of Wiener processes among our active developers. In the future, we're going to try to do better at telling people their issue isn't one we can support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants