In the code below I’m trying to add intercept to an autoregressive model. No matter what I do, stan complains about the signatures. All examples I’ve seen are the same as the code below. I get the same message even if I transpose c or y.
data {
int<lower=1> T; // number of time points
int<lower=1> K; // number of time series
int y[T, K]; // data
}
parameters {
real<lower=0> sigma;
real c[K];
}
model {
sigma ~ cauchy(0, 2.5);
c ~ normal(0, 1);
for (t in 2:T)
y[t] ~ normal(c + y[t-1], sigma);
}
Ill-typed arguments supplied to infix operator +. Available signatures:
(int, int) => int
(real, real) => real
(real, vector) => vector
(vector, real) => vector
(vector, vector) => vector
(complex, complex) => complex
(real, row_vector) => row_vector
(row_vector, real) => row_vector
(row_vector, row_vector) => row_vector
(real, matrix) => matrix
(matrix, real) => matrix
(matrix, matrix) => matrix
(complex, complex_vector) => complex_vector
(complex_vector, complex) => complex_vector
(complex_vector, complex_vector) => complex_vector
(complex, complex_row_vector) => complex_row_vector
(complex_row_vector, complex) => complex_row_vector
(complex_row_vector, complex_row_vector) => complex_row_vector
(complex, complex_matrix) => complex_matrix
(complex_matrix, complex) => complex_matrix
(complex_matrix, complex_matrix) => complex_matrix
Instead supplied arguments of incompatible type: array real, array int.