I have two models which run nicely and give me good posterior distributions.

Model 1 has the parameters hard coded and not done via a matrix, so it gives me outputs with names of the input variable (b_group_1_intercept).

Model 2 has the parameters submitted via a matrix, so it is more efficient, but the parameter names are b_group_1[1], b_group_1[2] etc.

Model 3 is the BRMS version of my model, which gives me the useful name muprop1_Intercept and the efficiency of the matrix.

My question is how do I get a model with the matrix’s efficiency and the nice naming system? Can I do still do this by sending independent variables one column at a time and building the design matrix in the transformed data block?

In Stan we’ve been adding vectorized glms for common models, and if you use them, you will get the distinction between the intercept and the slope terms. Here are a few examples:

The naming convention here is <distribution>_<link function>_glm - I’m not sure we have a comprehensive list of all the _glm distributions anywhere, nor is this mentioned in the Stan User’s Guide and it should be (will file an issue on this).

Here’s an example of how to set this up for simple linear regression with 2 predictors - this is the non-hierarchical version of the model for the radon dataset from Gelman and Hill 2007, chapter 12.