I’m facing trouble running the following syntactically correct program in Stan via R, trying both rstan (v. 2.21.2) and CmdStanR (v. 0.1.2).
data {
int<lower=1> N;
vector<lower = 0, upper = 1>[N] intra;
vector<lower = 0, upper = 1>[N] inter;
}
transformed parameters {
real<lower = 0, upper = 1> gap;
real alpha;
real beta;
gap = alpha * min(inter) - beta * max(intra);
}
model {
target += normal_lpdf(alpha | mean(inter), sd(inter));
target += normal_lpdf(beta | mean(intra), sd(intra));
}
Any ideas on what the problem could be here? rstan aborts my R session and in CmdStanR, the resulting error messages aren’t very informative, simply stating that the chains have finished unexpectedly.