Hi @mike-lawrence, sorry for the delay!
This is my model part:
model {
A ~ normal(0.5, 0.05);
to_vector(B) ~ normal(0, 0.05);
to_vector(C) ~ normal(0, 0.05);
to_vector(X1) ~ normal(0, 0.1);
mu_d ~ normal(0, 0.1);
sigma_r ~ normal(0, 0.1);
real X[N,W,Xdim];
for (s in 1:N) {
for (w in 1:W) {
if (w == 1) {
X[s,w,] = to_array_1d(inv_logit(X1[s,]));
} else {
X[s,w,] = to_array_1d(inv_logit(diag_matrix(A) * to_vector(X[s,w-1,]) + B * to_vector(U[s,w-1,])));
}
risk_lt_pr[s,w] ~ normal(mu_d[1] + C[1,] * to_vector(X[s,w,]),sigma_r[1]);
beta_lt_pr[s,w] ~ normal(mu_d[2] + C[2,] * to_vector(X[s,w,]),sigma_r[2]);
vector[Tr_lt[s,w]] Utility1 = to_vector(hi_p_lt[s,w,:Tr_lt[s,w]]) .* pow(to_vector(hi_narr_lt[s,w,:Tr_lt[s,w]]), risk_lt[s,w]) + to_vector(low_p_lt[s,w,:Tr_lt[s,w]]) .* pow(to_vector(low_narr_lt[s,w,:Tr_lt[s,w]]), risk_lt[s,w]);
vector[Tr_lt[s,w]] Utility2 = to_vector(hi_p_lt[s,w,:Tr_lt[s,w]]) .* pow(to_vector(hi_wide_lt[s,w,:Tr_lt[s,w]]), risk_lt[s,w]) + to_vector(low_p_lt[s,w,:Tr_lt[s,w]]) .* pow(to_vector(low_wide_lt[s,w,:Tr_lt[s,w]]), risk_lt[s,w]);
choice_lt[s,w,:Tr_lt[s,w]] ~ bernoulli_logit(beta_lt[s,w]*(Utility1 - Utility2));
}
}
}
Any idea about what might cause the identifiability issue will be very helpful!