Closed c0nfusedc0der closed 4 years ago
Thanks for submitting an issue! It looks like the clang
error is related to #774
For the error Y[i_0__] is -0.0570965, but must be greater than or equal to 0
It looks like you are setting Y
as real<lower=0>
. When you bring in Y
are all values greater than zero? Else that lower=0
will cause an exception to occur.
I tried the code from the other forum:
remotes::install_github("stan-dev/rstan", ref = "develop", subdir =
"rstan/rstan")
I removed the limits but this was the error/warning:
sh: clang++ -mmacosx-version-min=10.13: command not found
The NEXT version of Stan will not be able to pre-process your Stan program.
Please open an issue at
https://github.com/stan-dev/stanc3/issues
if you can share or at least describe your Stan program. This will help ensure that Stan
continues to work on your Stan programs in the future. Thank you!
This message can be avoided by wrapping your function call inside suppressMessages().
hash mismatch so recompiling; make sure Stan code ends with a blank line
SAMPLING FOR MODEL 'air001_stancode' NOW (CHAIN 1).
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: bernoulli_logit_lpmf: n[2] is 2, but must be in the interval [0, 1] (in 'model6c03ac9179b_air001_stancode' at line 62)
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: bernoulli_logit_lpmf: n[2] is 2, but must be in the interval [0, 1] (in 'model6c03ac9179b_air001_stancode' at line 62)
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: bernoulli_logit_lpmf: n[2] is 2, but must be in the interval [0, 1] (in 'model6c03ac9179b_air001_stancode' at line 62)
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: bernoulli_logit_lpmf: n[2] is 2, but must be in the interval [0, 1] (in 'model6c03ac9179b_air001_stancode' at line 62)
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: bernoulli_logit_lpmf: n[2] is 2, but must be in the interval [0, 1] (in 'model6c03ac9179b_air001_stancode' at line 62)
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: bernoulli_logit_lpmf: n[2] is 2, but must be in the interval [0, 1] (in 'model6c03ac9179b_air001_stancode' at line 62)
this continues and the end of the console messages:
Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: bernoulli_logit_lpmf: n[2] is 2, but must be in the interval [0, 1] (in 'model6c03ac9179b_air001_stancode' at line 62)
Chain 1:
Chain 1: Initialization between (-2, 2) failed after 100 attempts.
Chain 1: Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] "Error in sampler$call_sampler(args_list[[i]]) : Initialization failed."
[2] "In addition: Warning messages:"
[3] "1: In system2(CXX, args = ARGS) : error in running command"
[4] "2: In file.remove(c(unprocessed, processed)) :"
[5] " cannot remove file '/var/folders/9_/y248j5rj1rb82kfhskt4pm680000gn/T//Rtmp6T5T01/file6c059f5dd23.stan', reason 'No such file or directory'"
error occurred during calling the sampler; sampling not done
And line 62 is:
real md = bernoulli_logit_lpmf(id| discrim[i]*(theta[i]-delta[i])) ;
It sounds like this might be a model issue that would be better to post on discourse. I ran your model with the new compiler and cmdstan and it compiled fine so I think the The NEXT version of Stan
warning is a false positive from the clang++ -mmacosx-version-min=10.13
issue
Thank you so much! If the model ran and produced results for you then is there an issue with my setup or dataset? I'm not sure what my next step would be on discourse.
I have also attempted to use "brms" R package to use the make stan code function. It successfully worked on the built-in dataset as the example but produced a completely different model from mine, with the exact same rejection errors.
Sorry I by ran I just meant that the model compiled with the new compiler and cmdstan. I think your issue is a data one which should be posted on https://discourse.mc-stan.org/
It looks like id
needs to be between [0, 1] for bernouli_logit_lpmf
I think your issue is a data one which should be posted on https://discourse.mc-stan.org/
Closing this since it's a data issue. If I misinterpreted and this should stay open let me know and we can reopen.
Yes I believe it is a data issue. However when I have a Stan file open, the Rstudio console will sometimes give this message (even when I am not executing code and sometimes when I'm not editing code, simply opening a .stan file produces this).
sh: clang++ -mmacosx-version-min=10.13: command not found
Seems to not impact running code.
Thanks for letting us know. I'm glad that the message isn't preventing anything from running, but that's still annoying so we'll look into that.
For the clang message checkout #774
I am attempting to run Rstan code on a mac and received the following error:
My code is the following: