Hi all. Am trying to code a simple hierarchical model in Stan as an exercise.
I was trying to use discrete_range()
for the discrete uniform distribution for k on the set {1,2,3}. First, it will not accept k as integer parameter so I used real. Then in the model section it will not recognize discrete_range() with or without suffixes _lpmf, etc. How can I code this- Should I be using some other function besides discrete_range? Thanks
Mike
data {
int<lower=0> N;
int<lower = 0> y; //
}
parameters {
real<lower = 1> k; // Did not like int.
real<lower=0> t;
}
model {
y ~ poisson(10*k*t);
t ~ exponential(2/k);
k ~ discrete_range(1,3); \\ Will not accept discrete_range, or discrete_range_lpmf, etc.
}