Skip to content

Fix gamma_lccdf actually #3257

@spinkney

Description

@spinkney

See https://discourse.mc-stan.org/t/possible-issue-with-gamma-lccdf/

The function gamma_lccdf results in numerical instability for alpha approximately greater than 30. It’s due to gamma_q or grad_reg_inc_gamma. I can rewrite this to use gamma_p and grad_reg_lower_inc_gamma, which avoids potential instability in a tgamma(alpha) and digamma(alpha) call. It seems to sample a bit faster than just wrapping gamma_lcdf with log1m_exp.

Will put the PR in this week.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions