I'm trying to fit a bivariate unknown change point mixed model data comparable to the one described by Wang & McArdle, 2008 (DOI: 10.1080/10705510701758265).
I want to model a linear trend before the change point and a linear trend after the change point. The following is how I defined the respective likelihood. Is that right?
# likelihood for y1 and y2
for(i in 1:nsubj){
for(j in 1:ntime){
y1[i, j] ~ dnorm(muy1[i, j], tauy1)
muy1[i, j] <- b[i, 1] + b[i, 2] * x[i, j] + b[i, 3] * (max(0, x[i, j] - b[i, 4]))
y2[i, j] ~ dnorm(muy2[i, j], tauy2)
muy2[i, j] <- b[i, 5] + b[i, 6] * x[i, j] + b[i, 7] * (max(0, x[i, j] - b[i, 8]))
} }
How do I have to alter the likelihood if I assume no growth before the change point (and the intercept to be at .50) and linear growth after the change point?
Thanks in advance!
mcppackage looks really promising and I'll keep an eye on it and its future developments! Coming from R and lmer I really like the fact that I can "translate" code to jags. Unfortunately, for my current project I need the random effects. – achmed Jan 20 '20 at 13:54