stan-dev / example-models

Example models for Stan
http://mc-stan.org/
772 stars 479 forks source link

possible bug in Gaussian_Stan.R (vector[n]<lower=0>) #7

Closed bnicenboim closed 9 years ago

bnicenboim commented 9 years ago

I'm using rstan_2.4.0, if I leave the model as it is now I get the following error:

data { 
  int<lower=1> n;
  vector[n]

EXPECTED: <identifier> BUT FOUND: 

<lower=0> x;
}

I can of course fix it by removing from vector[n] x; But I was wondering if there's a new way to set a boundary in a vector... Or is this the new way, and it's a problem with my version?

bob-carpenter commented 9 years ago

Is there a specific model you're commenting on here in the example-models issue tracker?

The right syntax is the other way around.

vector<lower=0>[n] x;

If you can point out an example where we have it backwards in our examples, we can fix it.

bob-carpenter commented 9 years ago

Belay that last request---I found the code example and it's indeed a bug. It's in the Bayesian Cognitive Modeling book examples, so I'm assigning it to Martin.

martin-smira commented 9 years ago

It's fixed now. Thanks for reporting it bnicenboim!

bnicenboim commented 9 years ago

welcome! Thanks for the rstan examples! I'm pulling requests with the next things I'm pretty sure are bugs. I hope it's fine (and that I'm doing it fine)