@Kodiologist @GavinSimpson So here is my understanding. What Kodi wants to do
is definitely a mixed model, in the sense of Bates et al. see e.g. eq (2) here
cran.r-project.org/web/packages/lme4/vignettes/lmer.pdf. As far as I can see, X and Z design matrices are equal in this case. However, there is no way one can use lme4 to fit this (without hacking into the code): it allows only particular Z matrices that arise from the model formulas of the type (formula|factor).