Skip to content

Instantly share code, notes, and snippets.

@nazi123
nazi123 / How to choose M?
Last active November 4, 2019 10:44
tweedie in stan
data {
int <lower=1> N; // Sample size
int <lower=1> M; // m ~ poison(lambda)
real<lower=0> Y[N]; // outcome and each Yi=x1+x2+...+xm , and each xi ~ Gamma(alpha,gama) so Y|m ~ Gamma(m*alpha,gama)
}
parameters {
real<lower=0> mu;
real<lower=0> phi;