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

*_rng() functions that match all existing signatures available for corresponding *_lpdf() functions #3185

Open
mike-lawrence opened this issue Apr 30, 2023 · 1 comment

Comments

@mike-lawrence
Copy link
Contributor

At present, most *_rng() functions for quantities have a single signature, requiring loops to accommodate expressions that are otherwise expressable with a single line when using the corresponding *_lpdf() in the model block. What would it take to get equivalence in available signatures between *_lpdf() and corresponding *_rng() functions? Happy to help, but wouldn't know where to start!

@WardBrian
Copy link
Member

I think the primary work for this issue would be in the math library.

Based on the compiler, here are a list of distributions for which I believe the RNG and density signatures do match:

Details

 beta
 beta_binomial
 bernoulli
 bernoulli_logit
 binomial
 cauchy
 chi_square
 discrete_range
 double_exponential
 exp_mod_normal
 exponential
 frechet
 gamma
 gumbel
 hypergeometric
 inv_chi_square
 inv_gamma
 logistic
 loglogistic
 lognormal
 neg_binomial
 neg_binomial_2
 neg_binomial_2_log
 normal
 pareto
 pareto_type_2
 poisson
 poisson_log
 rayleigh
 scaled_inv_chi_square
 skew_double_exponential
 skew_normal
 student_t
 std_normal
 uniform
 von_mises
 weibull

There is one _rng function with no corresponding density:

hmm_latent

And the following densities have incomplete RNG signatures (usually missing vectorization):

beta_proportion
bernoulli_logit_glm
categorical
categorical_logit
dirichlet
inv_wishart_cholesky
inv_wishart
lkj_corr
lkj_corr_cholesky
multinomial
multinomial_logit
multi_normal
multi_normal_cholesky
multi_student_t
multi_student_t_cholesky
ordered_logistic
ordered_probit
wishart_cholesky
wishart_rng

And finally, missing RNG functions entirely:

binomial_logit
categorical_logit_glm
gaussian_dlm_obs
lkj_cov
multi_gp
multi_gp_cholesky
multi_normal_prec
neg_binomial_2_log_glm
normal_id_glm
ordered_logistic_glm
poisson_log_glm
wiener

For any given distribution above it would be pretty easy to have the compiler spit out the signatures which are still needed.

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

No branches or pull requests

2 participants