Please share your Stan program and accompanying data if possible.
When including Stan code in your post it really helps if you make it as readable as possible by using Stan code chunks (```stan) with clear spacing and indentation. For example, use
reinstatement_model = """
data {
int<lower=0> n; // number policy term years
int<lower=0> NonCatcvrcnt; // loss ratio
int<lower=0, upper = 1> alertflag; //alert flag
}
parameters {
real<lower=0> mu;
real beta;
real<lower = 0> sigma;
}
model {
mu ~ normal(0,1);
beta ~ normal(0,1);
NonCatcvrcnt ~ poisson_log(mu + beta*alertflag);
}
//generated quantities {}
"""
I’ve checked the data and it is an integer. These are insurance claims so there are a lot of zeros in the dataset. I’m not sure if that matters.
The specific error is “ValueError: Variable NonCatcvrcnt is neither int nor float nor list/array thereof”
Is there anything standard I could be doing wrong?