Improving the efficiency of fitting a model using stan_lmer

If you feel up to delving into coding in Stan directly, you might get a speed up by using the trick posted here. The mapping from that example’s terminology to yours is subject==job, you’ll want to use the formula “~ male+seniority” for the W matrix and “~1” for the B matrix.

I can’t recall if stan_lmer defaults to a centered or non-centered parameterization, but the example uses non-centered. You might also check if your W matrix has much correlation, and if so use the QR reparameterization from the manual (which I do think stan_lmer applies by default).

2 Likes