-
-
Notifications
You must be signed in to change notification settings - Fork 264
-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data named “i” is overwritten by rstan #654
Comments
i’ll see if I can sort this out quickly but I may have questions since I haven’t worked much with that part of the RStan code. |
I don't know why it's happening but it's happening when rstan/rstan/rstan/R/stanmodel-class.R Line 118 in ef3dace
and specifically when Lines 1607 to 1608 in ef3dace
Here's a minimal working example to trigger it. // test.stan
data {
int i;
vector[i] y;
}
parameters {
real mu;
}
model {
y ~ normal(mu, 1);
} # In R
standata <- list(i = 25, y = rnorm(25))
fit <- stan("test.stan", data = standata, iter = 1, chains = 1) I'll make a PR shortly that I think will fix this by giving |
An anonymous user on discourse reported an error that i helped them work around, but is a bug in RStan:
https://discourse.mc-stan.org/t/mismatch-in-dimensionality-stan-is-fixing-the-dimensionality-to-a-number-why/9158
It seems that an integer (probably other types too) named
i
(lower case) in the list passed todata
has its value overwritten when RStan processes/checks the data. The temporary workaround is for the user to just change the name from i to something else.The text was updated successfully, but these errors were encountered: