Dear friends - using your help I have fitted a double exponential decay curve to data from 24 rats belonging to three groups (control, diabetes, hyperglycemic) and the combined model below fits random effects to all four nonlinear parameters, and fixed effects to two of the parameters (for good reasons that are not relevant, I believe). The model is fine and repoduces all 24 decay curves over time (TT), and yields a perfect pp_check and correlation > 0.99 between fitted and measured concentrations.

[Pleprior2 <- c(prior(normal(300,300),nlpar=“A”,lb=10,ub=1000),

prior(normal(300,300),nlpar=“B”,lb=10,ub=1000),

prior(normal(5,5),nlpar=“g1”,lb=.0001),

prior(normal(5,5),nlpar=“g2”,lb=.0001)

)

system.time(Thin_raw_H3<- brm(bf(MMN~A*exp(-g1*TT/100)+B*exp(-g2*TT/100),

A + B ~ 1+(1|RAT), g1 + g2 ~ 1+TRT+(1|RAT),sigma ~ TRT ,nl=TRUE),data=dats,cores=4,prior = prior2,chains=1,control = list(adapt_delta = 0.95,max_treedepth = 20),iter = 2000))

Now the reason for it all is to find the glomerular filtration rate and this is had from

GFR <- V1*(A+B) / (A/G2 + B/G1) where Gs are 1e-2*gs and V1 is plasma volume known (approximately) for each rat.

Now, is it legitimate to take the four parameters from the fitted model directly as the posteriors with g1 and g2 different between TRT (groups)? Then multiplying with the mean of plasma volumes corresponding to the groups produces a sample of pseudoposterior estimates of GFR according to the groups. If so, how should I then compare say diabetics to controls? Using the perhaps contrived method sketched diabetics have higher GFR which I had also thought and the values are reasonable compared to the result obtained when fitting animail per animal - but this gives much worse overall fit.

Thank you so much and happy New Year