I would like to use the recently added “integrate_1d” function in stan (I am using Rstan and have only limited background in using C++). However, I have some trouble in understanding how to use this function. I would have expected something like
wherein a and b denote the limits of integration and wherein f denotes a
previously defined function. However, from the manual I gather the following:
"The integrate_1dfunction requires
- its first argument to refer to a function wth signature(real, real, real,real, int) : real,
- the remaining six arguments are assignable to types real,real,real,real,andint, and
- the fourth and fifth arguments must be expressions not containing any variablesnot originating in the data or transformed data blocks."
I do not understand this specification. What is the meaning of the arguments in the signature(real, real, real,real, int)?
Perhaps a small toy example would settle my questions.
Thanks for your help!