Given J groups and L group level predictors, there will be matrix[L, J] group coeffs, correct? The Stan Users Guide Section 1.13 Multivariate Priors for Hierarchical Models has parameter gamma as
matrix[L, K] where K is the number of individual predictors, as shown below. I did see this same thing reproduced in another example so wondering if I am missing something.
data {
int<lower=0> N; // num individuals
int<lower=1> K; // num ind predictors
int<lower=1> J; // num groups
int<lower=1> L; // num group predictors
array[N] int<lower=1, upper=J> jj; // group for individual
matrix[N, K] x; // individual predictors
array[J] row_vector[L] u; // group predictors
vector[N] y; // outcomes
}
parameters {
corr_matrix[K] Omega; // prior correlation
vector<lower=0>[K] tau; // prior scale
matrix[L, K] gamma; // group coeffs
array[J] vector[K] beta; // indiv coeffs by group
real<lower=0> sigma; // prediction error scale
}