Skellam distribution

Is the Skellam distribution available via APIs? If not, any workaround?

In what software are you referring?

In Stan, you can just code your own probability distributions in the function block from the math on wikipedia; something like, e.g.,

functions {
  
real skellam_lpmf(int k, real lambda1, real lambda2) {
  real r = k;
  return -( lambda1 + lambda2 ) + (r/2) * log( lambda1 / lambda2 ) 
         + log( modified_bessel_first_kind(k, 2 * sqrt(lambda1 * lambda2)));
  }

}
4 Likes