stan-dev / math

The Stan Math Library is a C++ template library for automatic differentiation of any order using forward, reverse, and mixed modes. It includes a range of built-in functions for probabilistic modeling, linear algebra, and equation solving.
https://mc-stan.org
BSD 3-Clause "New" or "Revised" License
735 stars 185 forks source link

Implement missing `cdf`/`lcdf`/`lccdf` functions for distributions #2657

Open rok-cesnovar opened 2 years ago

rok-cesnovar commented 2 years ago

Description

This is a checklist of all _cdf, _lcdf and _lccdf functions that are not implemented for their _lpdf and _lpmf counterparts.

I am not sure all of them make sense or are even something we would want to implement, I am just listing all of the theoretically missing. If someone has insight, please comment and we can remove any of them.

loglogistic and beta_proportion are the only two where cdfs are partially supported, the rest of them have no cdf functions implemented.

Current Version:

v4.2.1

spinkney commented 2 years ago

FYI, some of these are really difficult...like multi normal and involve integrating the pdf.

rok-cesnovar commented 2 years ago

Thanks, updated the list, if there are any other that are difficult, just remove them from the list. I think having a list of missing but doable cdf functions would be helpful.

bachlaw commented 2 years ago

Would appreciate it if categorical and/or multinomial CDFs could be added to the math library. It looks like folks have had success using truncated Poisson variables to generate at least the multinomial CDF, relying on an article by Bruce Levin. https://cran.r-project.org/web/packages/pmultinom/pmultinom.pdf; https://github.com/fennerm/pmultinom. The latter is already in C++.

bachlaw commented 2 years ago

I note this suggestion on the Discourse of a multinomial probit implementation that might be worth pursuing: https://discourse.mc-stan.org/t/multinomial-probit-in-stan/17583

yananlong commented 1 year ago

Any chance that loglogistic lccdf will be implemented soon?