My stan model is as following,

data {

int<lower=0> N;

real<lower=0> lower_logtiter[N];

real<lower=0> upper_logtiter[N];

int<lower=0,upper=1> infection[N];

}

parameters {

real alpha; // mean titer =2

real<lower=0> sigma; // sd titer =1

real<upper=0> rate; // risk rate =-0.3

real<lower=0,upper=1> risk; // basic risk

}

model {

alpha ~ normal(0,10);

sigma ~ cauchy(0,10);

rate ~ cauchy(0,10);

risk ~ cauchy(0,10);

for (n in 1:N)

target += log(normal_cdf( upper_logtiter[n] , alpha, sigma) - (lower_logtiter[n]>=1)*normal_cdf(upper_logtiter[n] - 1 , alpha, sigma)); // interval censored titer

for (n in 1:N)

target += bernoulli_lpmf(infection[n] | fmin(fmax(risk+rate*(lower_logtiter[n] + upper_logtiter[n])/2,0),1)); // infection

}

and my data is data.csv (18.0 KB)

after I run the stan model, it always showed that reject initial value, I donâ€™t know whatâ€™s wrong with my model.