Issues working with example models from Stan-Dev

Hello. New user here trying to work with basic mixed effects models.

This is kind of a dumb question, but I’m trying to recreate the models from the Stan Dev page: example-models/electric.stan at master · stan-dev/example-models · GitHub .

However, in the data block, the array line gives me an error, saying “PARSER EXPECTED: a variable declaration, …”. The other weird part is that array[N] does not turn a different color, the way it is for other data types. Not really sure what to do, looking for some help.

Thank you.

Hi, these models are done for more recent versions of Stan - the array syntax for example was added in Stan 2.26, but you are most likely using rstan 2.21.

You can use an older snapshot of this repository, before we updated it to the latest syntax: GitHub - stan-dev/example-models at 861e89ec0411283af27d71b3006f91451077675b

1 Like