I would like to vectorize the random effects model because it is running slowly, but I don’t know how to do it.

```
data {
int N; //size
int M; // num of predictor (include intercept)
int G; // num of team
vector[N] y ; // outcome
matrix[N, M] x; // independent variable
int teamID[N] // team label
}
parameters{
vector[M] beta[G]; //random effects
vector[M] gamma; // fix effects
real<lower=0> sigma; sd
vector<lower=0> [M] tau; random sd vector
corr_matrix[M] omega;
}
transformed parameters{
cov_matrix[M] Tau;
Tau = quad_form_diag(omega, tau);
}
model{
vector[N] mu;
for (i in 1:N){
mu[i] = x[i] *beta[teamID[i]];
}
y ~ normal(mu, sigma);
beta ~ multi_normal(gamma, Tau);
gamma~ normal(0, 100);
sigma~ cauchy(0, 5);
tau ~ cauchy(0, 5);
omega ~lkj_corr(1);
}
```

Thank you in advance.

Plz help me. plz