#include in stan 2.16


#1

Hi,

While the stan user manual allows #include I wasn’t able to include from cmdstan. Is it not implemented yet?

Linas


#2

What was the problem error message (if there was any)?

Remove all the whitespace (from the line) before the #include.


#3

And everything after the .stan at the end, such as comments. Also, make sure there is no whitespace in the path.


#4

Thanks, it fixed.


#5

We’ll be updating the behavior to be more flexible soon. My bad in not supporting the R syntax Ben came up with for RStan the first time.


#6

Yep, I still have problems. I have 4 models and use include. Sometimes
it goes fine but sometimes it dumps all include file and gives error
whitespace end of file. I really want to have in includefile two blocks
that are common for all the modules:
functions {

}
data {

}
but ended up having in main:
functions {
#include fun.stan
}
data {

}
since I was unable to have second include - it said that include file is
not found.

Linas


#7

Are you using CmdStan or one of the other interfaces?


#8

CmdStan. Sorry, I intended to put it on the subject line…