There is no such thing as a three-dimensional matrix in Stan where a matrix is defined in the linear algebra sense. You can, however, have a set (called an array in Stan) of L matrices that each have K rows and D columns. To do so, write
matrix<lower=0>[K,D] sigma; // impose the constraint
beta object can be accessed (almost) like a list of KxD matrices in R, except that you just use single brackets (as in
beta) rather than double brackets (like
beta[]) to access the matrix for the first person in the data.
However, you need to keep in mind that in multinomial logit, it is conventional to restrict one column of
beta[i] to be all zeros, so really everything would be declared with
D - 1 columns. Also, in a hierarchical model, you probably want to use a non-centered re-parameterization of the normal prior, but we can get to that after you have something running with your parameterization.