Hello all,
I have a question. Suppose I create some variables in the Model part of the Stan program as given :
model {
vector[N] X1;
vector[N] X2;
vector[N] X3;
X1 = alpha_X1 + Z1*beta_Z1;
X2 = alpha_X2 + Z2*beta_Z2;
X3 = alpha_X3+ Z2*beta_Z3;
Y ~normal(alpha + X1 * beta_1+ X2 * beta_2 + X3 * beta_3, sigma);
}
My question is instead of writing like X1 * beta_1+ X2 * beta_2 + X3 * beta_3 , can I put X1, X2 and X3 into a matrix, something like matrix[N,3] X?
This will then allow me to write my likelihood as :
Y ~normal(alpha + X*beta, sigma);?
Thanks for your help in advance.
Regards
Ants.