Hi,

I’m trying to estimate a count model with over-dispersion for a variable, that only contains positive integers. Therefore, I chose for a NegBin II model, i.e. the neg_binomial_2_log distribution of Stan. My model is as follows:

data {

int<lower=1> N; // no. observations

int<lower=1> P; //no. predictors

int<lower=1> y[N]; //min. 1

matrix[N, P] x;

}parameters {

real intercept;

vector[P] beta; // one beta for each predictor

real<lower=0> phi; // over-dispersion parameter

}model {

vector[N] mu;

mu = intercept + x*beta;

for (n in 1:N) {

y[n] ~ neg_binomial_2_log(mu[n], phi) T[1,]; // zero-truncated NegBin II?

}

}

Due to the value range of the DV, I need to use truncation, however, the code does not compile, as there seems to be no CDF for neg_binomial_2_log. Is there an alternative to be still able to estimate this model?

Best regards

Christian