Hello!
I am following the Stan User Guide Tutorial for Prior Predictive Checks, and am running into a sampling issue. My code for the model is copied straight from the guide:
data {
int<lower = 0> N;
vector[N] x;
}
generated quantities {
real alpha = normal_rng(0, 1);
real beta = normal_rng(0, 1);
real y_sim[N] = poisson_log_rng(alpha + beta * x);
}
This is how I am sampling
x <- rnorm(100, mean = 53, sd = 9)
ppc <- stan_model("prior-post-pred-check.stan")
fit <- sampling(ppc,
data = list(N = 100, x = x),
chains = 1, iter = 2000,
algorithm="Fixed_param")
And I am receiving errors such as:
Exception: poisson_log_rng: Log rate parameter[1] is 80.031, but must be less than 20.7944 (in 'string', line 8, column 2 to column 52)
Chain 1: Exception: poisson_log_rng: Log rate parameter[1] is 78.6089, but must be less than 20.7944 (in 'string', line 8, column 2 to column 52)
I have received errors doing similar things for both negative binomial regressions and basic linear regression, so in general I am confused on how these errors happen. Thank you.