Hi everyone,
After running the following code, I get the following warning messages, which I do not know if can cause a major problem for my model? Does this mean that the model did not reach convergence?
fit_modellong ← sampling(modellong,
data = datalist,
init = function(){
list(pAB0= -2, uAB = 0.053, uASC0 = -2, sigma = 0.01, sigmapAB = 0.01, sigmauASC = 0.01, rpAB = rnorm(indivs, 0.001, 0.01), ruASC = rnorm(indivs, 0.001, 0.01), z_init = as.array(c(1766, 654), dim = 2)) }
,iter = 2000,
chains = 1,
seed = 0, control = list (stepsize = 0.1))
Warning message:
functions {
vector model3(real t, vector y, real pAB, real uAB, real uASC) {
vector[2] dydt;
dydt[1] = pAB*y[2]-uAB*y[1];
dydt[2] = -uASC*y[2];
return dydt;
}
}
data {
int <lower=1> nobs;
real t0;
vector[2] y0;
real ts[nobs];
int <lower=1> indivs;
real <lower=0> antib[nobs];
//real <lower=1, upper=indivs> subj[nobs];
}
parameters {
real pAB0;
real <lower=0> uAB;
real uASC0;
real <lower=0> sigma;
real <lower=0> sigmapAB;
real <lower=0> sigmauASC;
real rpAB[indivs];
real ruASC[indivs];
vector<lower=0>[2] z_init;
}
model {
vector[2] yhat[nobs];
//prior distributions
pAB0 ~ normal(-2, 0.5);
uASC0 ~ normal(-2, 0.5);
uAB ~ normal(0, 0.001);
sigmapAB ~ inv_gamma(0.01, 0.01);
sigmauASC ~ inv_gamma(0.01, 0.01);
sigma ~ inv_gamma(0.01, 0.01);
z_init[1] ~ normal(1764, 0.001);
z_init[2] ~ normal(654, 0.001);
for (j in 1:indivs) {
real pAB = exp(pAB0)*exp(rpAB[j]);
real uABt = uAB;
real uASC = exp(uASC0)*exp(ruASC[j]);
yhat = ode_rk45(model3, z_init, t0, ts, pAB, uABt, uASC);
//likelihood
for (i in 1:nobs) {
antib[i] ~ normal(yhat[i,2], sigma);
// where mu of the r.e. is 0 or -sigmapAB/2
rpAB[j] ~ normal(0.01, sigmapAB);
ruASC[j] ~ normal(0.01, sigmauASC);
}
}
}
generated quantities {
real z_pred[nobs];
for (t in 1:nobs){
z_pred[t] = normal_rng(antib[t], sigma);
}
}