# Dirichlet for diferent vectors

Hi. I am trying to fit a GARCH for multiple vectors using a Dirichlet for alpha and beta but It seems like the code can not het the parameters for different vectors.

This is my code

``````data {
int<lower=0> T;
matrix[T, 4] R;
row_vector<lower=0>[4] sigma1;
int<lower=0> K;
int<lower=0> V;
row_vector<lower=0>[4] omega_star;
matrix<lower=0>[4, V] alpha_beta_star;
}

parameters {
row_vector<lower=0,upper=1>[4]  omega;
row_vector<lower=0,upper=1>[4]  alpha;
row_vector<lower=0,upper=1>[4] beta;
simplex[K] alpha_beta[4];
}

transformed parameters{
matrix<lower=0>[T,4]h;
for (i in 1:4){
h[1,i] = sigma1[i];
}

for (t in 2:T){
for (i in 1:4){
h[t,i] = sqrt(omega[i]
+ alpha[i] * pow(R[t-1,i], 2)
+ beta[i] * pow(h[t-1,i],2));
}

}
}

model {
//priors

for (i in 1:4){
omega[i] ~ gamma(omega_star[i],2);
alpha_beta[i] ~ dirichlet(alpha_beta_star[i]);
}

//likelihood
for (i in 1:4){

R[i] ~ normal(0, h[i])
}

}

``````

Can some one give an advice about how to write the dirichlet?

Thanks