I have the following data and code in R
> str(stan_data_list)
List of 4
$ N: int 3998
$ K: int 13
$ y: int [1:3998] 6 5 10 10 8 3 8 9 9 5 ...
$ X: num [1:3998, 1:13] 1 1 1 1 1 1 1 1 1 1 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : chr [1:3998] "1" "2" "3" "4" ...
.. ..$ : chr [1:13] "hotlineyes" "ram8MB" "screen17in" "cpu50MHz" ...
> m.stan <- stan(model_code = "alex_lm.stan",
data = stan_data_list, iter = 1000, chains=1)
This returns the following error:
PARSER EXPECTED: whitespace to end of file.
FOUND AT line 1:
alex_lm.stan
data {
int N; //nrows
int K; //ncols
vector[N] y; //dim output
matrix[N,K] X; //dim input
}
parameters {
real beta0;
vector[K] beta; //dim = input col
real<lower=0> sigma;
}
model {
y ~ normal(beta0 + X*beta, sigma);
}
What are some possible sources of this error?
Thanks!