math icon indicating copy to clipboard operation
math copied to clipboard

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

Open rok-cesnovar opened this issue 4 years ago • 5 comments

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.

  • [ ] bernoulli_logit_glm_cdf, bernoulli_logit_glm_cdf_lcdf, bernoulli_logit_glm_cdf_lccdf
  • [ ] bernoulli_logit_cdf, bernoulli_logit_lcdf, bernoulli_logit_lccdf
  • [ ] beta_proportion_cdf
  • [ ] binomial_logit_cdf, binomial_logit_lcdf, binomial_logit_lccdf
  • [ ] categorical_logit_glm_cdf, categorical_logit_glm_lcdf, categorical_logit_glm_lccdf
  • [ ] categorical_logit_cdf, categorical_logit_lcdf, categorical_logit_lccdf
  • [ ] categorical_cdf, categorical_lccdf, categorical_lccdf
  • [ ] dirichlet_cdf, dirichlet_lcdf, dirichlet_lccdf
  • [ ] gaussian_dlm_obs_cdf, gaussian_dlm_obs_lcdf, gaussian_dlm_obs_lcccdf
  • [ ] hypergeometric_cdf, hypergeometric_lcdf, hypergeometric_lccdf
  • [ ] inv_wishart_cdf, inv_wishart_lcdf, inv_wishart_lccdf
  • [ ] lkj_corr_cholesky_cdf, lkj_corr_cholesky_lcdf, lkj_corr_cholesky_lccdf
  • [ ] lkj_corr_cdf, lkj_corr_lcdf, lkj_corr_lccdf
  • [ ] loglogistic_lcdf, loglogistic_lccdf
  • [ ] neg_binomial_2_log_glm_cdf, neg_binomial_2_log_glm_lcdf, neg_binomial_2_log_glm_lccdf
  • [ ] neg_binomial_2_log_cdf, neg_binomial_2_log_lcdf, neg_binomial_2_log_lccdf
  • [ ] normal_id_glm_cdf, normal_id_glm_lcdf, normal_id_glm_lccdf
  • [ ] ordered_logistic_glm_cdf, ordered_logistic_glm_lcdf, ordered_logistic_glm_lccdf
  • [ ] ordered_logistic_cdf, ordered_logistic_lcdf, ordered_logistic_lccdf
  • [ ] ordered_probit_cdf, ordered_probit_lcdf, ordered_probit_lccdf
  • [ ] poisson_log_glm_cdf, poisson_log_glm_lcdf, poisson_log_glm_lccdf
  • [ ] poisson_log_cdf, poisson_log_lcdf, poisson_log_clcdf
  • [ ] wiener_cdf, wiener_lcdf, wiener_lccdf
  • [ ] wishart_cdf, wishart_lcdf, wishart_lccdf

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

rok-cesnovar avatar Jan 14 '22 10:01 rok-cesnovar

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

spinkney avatar Jan 14 '22 12:01 spinkney

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.

rok-cesnovar avatar Jan 14 '22 12:01 rok-cesnovar

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 avatar Mar 17 '22 13:03 bachlaw

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

bachlaw avatar Jun 05 '22 17:06 bachlaw

Any chance that loglogistic lccdf will be implemented soon?

yananlong avatar Feb 07 '23 08:02 yananlong