# Log Pearson III (LP3) distribution in Stan

Hello,
does anyone of you know whether it is possible to model a LP3 distribution in Stan?
Thanks a lot!

You an implement any probability distribution with a closed form density function representation in Stan. If I understand correctly the Pearson III family is equivalent to the gamma family, which already implemented as gamma_lpdf.

More generally the Pearson family could also be defined through its ordinary differential equation representation with Stan’s numerical ordinary differential equation solvers. Every time you want to evaluate \pi(x \mid \lambda) you’d integrate the ordinary differential equation from the appropriate initial condition to x. That said this approach will be computationally expensive and potentially numerically fragile so using analytic results will always be preferable when available.