Create Reusable functions in Pystan

Is it possible to create a stan script storing reusable functions in Pystan?

Hope my question make sense.

1 Like

If I understand correctly then yeah you can do this. Stan supports #include statements, which can be used to include the contents of one Stan file into another:

You’ll also need to specify the include_paths argument when fitting the model in order to tell it where to look for the included files.

3 Likes