I'm trying to solve a model based on a ODE. However, in order to make my ODE work within stan, everything is being calculated using vectors. When I attempt to compile, I get the following error:
stan/lib/stan_math/stan/math/prim/arr/functor/coupled_ode_system.hpp:98:15: error: no match for ‘operator=’ (operand types are ‘std::vector<double>’ and ‘Eigen::Matrix<double, -1, 1>’)
dy_dt = f_(t, y, theta_dbl_, x_, x_int_, msgs_);
^
In file included from /usr/include/c++/5/vector:69:0,
from stan/lib/stan_math/stan/math/memory/stack_alloc.hpp:12,
from stan/lib/stan_math/stan/math/rev/core/autodiffstackstorage.hpp:4,
from stan/lib/stan_math/stan/math/rev/core.hpp:4,
from stan/lib/stan_math/stan/math/rev/mat.hpp:4,
from stan/lib/stan_math/stan/math.hpp:4,
from stan/src/stan/model/model_header.hpp:4,
from ./examples/platelets/platelets.hpp:3,
from <command-line>:0:
/usr/include/c++/5/bits/vector.tcc:167:5: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = double; _Alloc = std::allocator<double>]
vector<_Tp, _Alloc>::
^
/usr/include/c++/5/bits/vector.tcc:167:5: note: no known conversion for argument 1 from ‘Eigen::Matrix<double, -1, 1>’ to ‘const std::vector<double>&’
make/models:10: recipe for target 'examples/platelets/platelets' failed"
I interpret this error that I can't return a vector to use with stan's ODE solvers. If so, is there a way to convert a vector into an acceptable data type, or should I just rewrite the model using different data types?