fixed_factors.R (2.2 KB)

Dear friends - I simulated some data to represent actual experimental data on 3 groups of rats on which double exponential decay of a tracer is modelled. With your help I got a fine fit with Rhat values = 1 as long as I only modled one population. Doing all three together as shown below was more problematic. Rhat still being 1 pp_check had an unreproduced large central peak. And for the three groups fitted values didn’t match the original data too well except for the controls. I noticed that it didn’t matter if I had specified as below or as A + B + g1 + g2 ~ TRT. So I wonder how I happened to miss-specify the fixed effects of TRT

fit4 <- brm(bf(YY ~ A * exp( - g1 * TT/1000)+B * exp( -g2 * TT/1000),

A + B + g1 + g2 ~ 1+TRT,nl=TRUE, sigma ~ TRT),data=dats,cores=4,prior = prior1,chains=4,control = list(adapt_delta = 0.8,max_treedepth = 10),iter = 2000)

I uploaded the simulation and the model code for plots

Best wishes

Troels