I’ve been using Stan for ODEs for some time now, many thanks. With the newer way of writing and solving ODEs I stumbled into the following difficulty: I need to specify ode functions like:
vector myodes(real t, vector y, vector bw_t, vector bw_y, array[] real p)
{
vector[N] dydt;
........
return dydt;
}
The above works well, no problems. But I need to specify tolerances, and would like to use ode_bdf_tol. From the documentation, I find that ode_bdf_tol does not seem to accept my parameters bw_t and bw_y, which are vectors. From the docs
Could you advice me on whether I’m doing something wrong, or if there is a workaround to my problem?
Ill-typed arguments supplied to function 'ode_bdf_tol':
(<F1>, vector, real, array[] real, vector, vector, real, real, int, array[] real)
where F1 = (real, vector, vector, vector, array[] real) => vector
Available signatures:
(<F1>, vector, real, array[] real, data real, data real, data int, vector, vector, array[] real) => vector
The 5th argument must be real but got vector
@yizhang’s suggestion solved my issue. My script now compiles without error.