BRMS: Implementation of sum to zero constraints

Hey,

I am fitting a condition logit model with a factor smooth, i.e.

bf(
  y ~ 1,
  nlf(mu1 ~ intercept + bdonation * donation1),
  nlf(mu2 ~ intercept + bdonation * donation2),
  intercept ~ 1 + s(t, id, bs = "fs", xt = "ps", m = c(2, 1), k = 5),
  bdonation ~ 1 + s(t, id, bs = "fs", xt = "ps", m = c(2, 1), k = 5),
  family = categorical(refcat = "3")
) 

where t, donation1 and donation2 are continuous variables and id is a factor.

While everything is estimated stabile since (according to other posts in this forum) there is a sum to zero constraint on the factor smooths, we noticed something strange when investigating the results:
From a graphical analysis, it seems that the sum to zero constraint does not apply to the sum over all levels of id and over the domain of t, but to the sum over all levels of id at each point in the domain in t:
donaton.pdf (8.4 KB)
The red line is the global coefficient, i.e. the estimate of bdonation, the green line is the mean over the spline curves at each point in time t.

However, we are not completely sure whether or not this is caused by the sum to zero constraint or caused be the average effect between factor levels actually being zero.

Could someone verify how the sum to zero constraint is implemented in brms, i.e. if it applies to the sum over all levels of id and over the domain of t or to the sum over all levels of id at each point in the domain in t.

Thank you very much!

  • Operating System: Windows 10
  • brms Version: 2.18.0