Dot product between matrix and vector

I’m keep getting an error when multiplying a matrix by a vector. Here is the code

data {
  int<lower=1> T;  
  int<lower=1> K;  
  int y[T, K];     
}

parameters {
  simplex[T] theta[K];     
  simplex[T] transition_matrix[K];
}

model {
  theta[1] ~ dirichlet(rep_vector(1, K));
  
  for (k in 1:K)
    transition_matrix[k] ~ dirichlet(rep_vector(1, K));
    
  for (t in 2:T)
    theta[t] ~ dirichlet( dot_product(transition_matrix, theta[t-1]) )
}

Ill-typed arguments supplied to function ‘dot_product’:
(array vector, vector)
Available signatures:
(vector, vector) => real
The first argument must be vector but got array vector
(vector, row_vector) => real
The first argument must be vector but got array vector
(row_vector, row_vector) => real
The first argument must be row_vector but got array vector
(row_vector, vector) => real
The first argument must be row_vector but got array vector
(array real, array real) => real
The first argument must be array real but got array vector
(Additional signatures omitted)

To multiply a matrix times a vector you wouldn’t use dot_product, just regular multiplication with *. But you actually have an array of simplex vectors not a matrix. So you’d need to put them in a matrix (e.g. you can create a temporary variable in the model block) before doing matrix * vector.

Could you provide an example as In relatively new to the language?

Thank you