# Trying QR Decomposition with a brms multilevel categorical model causes an error

I must fit dozens of multilevel categorical models with two group-level factors. It usually takes about 90 minutes to fit one model (and frequently even longer to calculate loo posteriors). Tips 3 and 4 in post 3 of this thread suggest that dramatic time savings might be achieved by using CmdStanR as backend and employing something called “QR decomposition” (I have no idea what it does). But when I try to implement this advice, I get an error message:

``````require(brms)
require(cmdstanr)
(mypriors <- get_prior(dep.var ~ (1|CompLemma) + ThatOmit + Word.Dist + time.period + polarity, family = categorical, data = d))
mypriors\$prior[mypriors\$class == "Intercept"] <- "normal(0, 5)"
mypriors\$prior[mypriors\$class == "sd"] <- "exponential(2)"
mypriors\$prior[mypriors\$class == "b"] <- "normal(0, 2.5)"
mypriors\$prior[mypriors\$coef == "Word.Dist"] <- "normal(0, 0.25)" # a continuous covariate with a large SD
testmod <- brm(dep.var ~ (1|CompLemma) + ThatOmit + Word.Dist + time.period + polarity, prior = mypriors, family = categorical, data = d, decomp = "QR", backend = "cmdstanr")
``````

Error in .fun(data = .x1, seed = .x2, init = .x3, decomp = .x4, iter_sampling = .x5, : **
** unused argument (decomp = .x4)

What am I doing wrong?

I use the QR decomp by including the call inside the forumula

``````testmod <- brm(bf(
dep.var ~ (1|CompLemma) +
ThatOmit +
Word.Dist +
time.period +
polarity,
decomp = "QR"
),
prior = mypriors,
family = categorical,
data = d,
backend = "cmdstanr")

``````

Does that work for you?

Yes it does. Thanks!