Hello,
I’ve not included reproducible code here because my question is largely about practical application in brms, and not about model diagnostics or errors per se.
I am currently using brms to model individual-level responses to a binary and ordered stimulus across time where the response is measured continuously. However, the degree to which the population (not the individuals) respond to the stimulus is probably modulated by an environmental parameter (for the sake of this example, we will say light exposure in lux). In mgcv, this problem is approached by using a ti() tensor, for example:
mod = bam(Response ~ Stimulus + s(Time, k = 4, bs = "cr") +
s(Time, by = Simulus, k = 4, bs = "cr", m = 1) +
s(Lux, k = 8, bs = "tp") +
ti(Time, Lux, Stimulus, k = (4,8), bs = ("cr", "tp", "fs")) +
s(Time, Individual_ID, by = Stimulus, bs = "re"),
data = Data,
method = "REML"))
wherein ti() ensures that concurvity between splines and the sole tensor are low (I’m also ignoring autocorrelation here and am assuming that individual differences are generalisable by linear slopes). In brms, I understand that ti() tensors are not available, yet replacing ti() with t2() should result in ugly concurvity issues (regardless of how penalisation is partitioned). So, In practice, I understand that I could remodel the above example as:
mod = bam(Response ~ Stimulus +
t2(Time, Lux, k = c(4, 8), bs = c("cr", "tp"), full = TRUE) +
t2(Time, Lux, by = Stimulus, k = c(4, 8), bs = c("cr", "tp"), m = 1) +
s(Time, Individual_ID, by = Stimulus, bs = "re"),
data = Data,
method = "REML"))
which is not identical, but cleaner and would be accepted in brms with reduced risk of concurvity. I am, however, highly skeptical of modelling random slopes for individuals if the main effect of the parameter across which individuals vary is not included. Am I correct in this skepticism? If so, would anyone have suggestions as to how concurvity issues could be circumvented without need for a ti() tensor?
Thanks