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)