You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following two data files, to be used with src/models/basic_estimators/normal_mixture:
foo.data.R:
N <- 5
y <- c(15, -6, -138109526142584496, 37.5, 4.3)
bar.data.R:
N <- 5
y <- c(15, -6, -1381, 37.5, 4.3)
The program runs fine with --data=bar.data.R, but when given --data=foo.data.R it dies with a "variable does not exist" error. Note that y is declared to be a real array in normal_mixture.stan; although y[3] is too large to be a 32-bit integer, it is a perfectly valid 64-bit floating-point value.
I ran into this problem using a data file written out by R.
The text was updated successfully, but these errors were encountered:
I just looked into the feasibility of fixing this. I think it's difficult dealing with it now. We don't pass into the reader the type it should be looking for. If we did, then we'd be able to read that integer as a double and be able to handle it fine.
There is a workaround to this problem:
make the data a floating point number instead of an integer. All that's required is adding a "." to the end of the number. I'm not sure if RStan's stan_rdump() function already takes care of that.
@ksvanhorn, does R still behave that way? If it does, can you try using RStan's stan_rdump()? If using that function creates data this way, then I'll open up an issue in RStan. I'll close this one for the time being because I think we're inferring the right type based on the input; it's just not as robust as we'd like.
Consider the following two data files, to be used with src/models/basic_estimators/normal_mixture:
foo.data.R:
N <- 5
y <- c(15, -6, -138109526142584496, 37.5, 4.3)
bar.data.R:
N <- 5
y <- c(15, -6, -1381, 37.5, 4.3)
The program runs fine with --data=bar.data.R, but when given --data=foo.data.R it dies with a "variable does not exist" error. Note that y is declared to be a real array in normal_mixture.stan; although y[3] is too large to be a 32-bit integer, it is a perfectly valid 64-bit floating-point value.
I ran into this problem using a data file written out by R.
The text was updated successfully, but these errors were encountered: