I noticed this while generating some model formulas automatically inside of a loop. If one specifies an intercept-only model, several parameters are not expected as input in the stan code (because they are unnecessary). However, the stan code that gets added for decomp = "QR" depends on the predictor matrix and the number of predictors, so the Stan code doesn't compile.
This is easy to fix, but maybe worth implementing a check/error message for users who do this on accident.
Reprex:
brm(
formula = bf(
mpg ~ 1,
decomp = 'QR'
),
data = mtcars
)
I noticed this while generating some model formulas automatically inside of a loop. If one specifies an intercept-only model, several parameters are not expected as input in the stan code (because they are unnecessary). However, the stan code that gets added for
decomp = "QR"
depends on the predictor matrix and the number of predictors, so the Stan code doesn't compile.This is easy to fix, but maybe worth implementing a check/error message for users who do this on accident.
Reprex: