Hi All,
Why the parser syntax error when it seems to be telling me that the argument types I’m giving are what it wants (macOS Big Sur 11.6.5 iMac, rstan 2.21.1, stan 2.21.0)? Why the distinction between `vector’ and ‘vector’? Thanks for the help. Best, Jarrett (comments stripped in Stan code below)
Stan code excerpts:
data{
…snip…
vector[Nl1] ltime1;
…snip…
}
…snip…
parameters {
real<lower=0> rDorm;
real<lower=0> rCmD;
real<lower=0> aCampus;
…snip…
}
transformed parameters{
real rCampus = rCmD + rDorm;
vector[Nl1] f1;
matrix[Nl1, Nl1] L_K;
{
matrix[Nl1, Nl1] K;
K = gp_exp_quad_cov(ltime1, aCampus, rCampus);
// diagonal elements
for (n in 1:Nl1) {
K[n, n] = K[n, n] + delta;
}
L_K = cholesky_decompose(K);
f1 = L_K * eta1 + loadmean;
}
}
…snip…
In R:
library(rstan, quietly=TRUE)
rstan (Version 2.21.1, GitRev: 2e1f913d3ca3)
…snip…
COVICoMo.stanc<- stanc(file=“./COVICoMoNEW.stan”)
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
No matches for:
gp_exp_quad_cov(vector, real, real)
Available argument signatures for gp_exp_quad_cov:
gp_exp_quad_cov(real, real, real)
gp_exp_quad_cov(real, real, real, real)
gp_exp_quad_cov(vector, real, real)
gp_exp_quad_cov(vector, vector, real, real)
gp_exp_quad_cov(vector, real, real)
gp_exp_quad_cov(vector, vector, real, real)
error in ‘model1445b75cec0ce_COVICoMoNEW’ at line 94, column 49
92: // ltime2. (Or combine obs/pred times and obtain predictions here.)
93: matrix[Nl1, Nl1] K;
94: K = gp_exp_quad_cov(ltime1, aCampus, rCampus);
^
95: // diagonal elements
Error in stanc(file = “./COVICoMoNEW.stan”) :
failed to parse Stan model ‘COVICoMoNEW’ due to the above error.
stan_version()
[1] “2.21.0”