If you call make_stancode
and compile it with verbose = TRUE
, you eventually get
file73bd1013dd8a.cpp:154:49: error: no matching function for call to ‘integrate_ode_rk45(model73bd1c443702_SIR_namespace::ode_SIR_functor__, std::vector<stan::math::var>&, int, std::vector<int>, std::vector<stan::math::var>&, std::vector<double>, std::vector<int>, std::ostream*&, double, double, double)’
stan::math::assign(y, integrate_ode_rk45(ode_SIR_functor__(), y0, 0, rep_array(t, 1), theta, rep_array(0.0, 0), rep_array(1, 1), pstream__, 1.0E-10, 1.0E-10, 1.0E3));
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/arr.hpp:46,
from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat.hpp:344,
from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:12,
from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math.hpp:4,
from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file73bd1013dd8a.cpp:8:
/home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:70:1: note: candidate: ‘template<class F, class T1, class T2> std::vector<std::vector<typename stan::return_type<T_shared_param, T_job_param>::type> > stan::math::integrate_ode_rk45(const F&, const std::vector<T>&, double, const std::vector<double>&, const std::vector<T_l>&, const std::vector<double>&, const std::vector<int>&, std::ostream*, double, double, int)’
integrate_ode_rk45(const F& f, const std::vector<T1>& y0, double t0,
^~~~~~~~~~~~~~~~~~
/home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:70:1: note: template argument deduction/substitution failed:
file73bd1013dd8a.cpp:154:49: note: cannot convert ‘stan::math::rep_array(const T&, int) [with T = int](1)’ (type ‘std::vector<int>’) to type ‘const std::vector<double>&’
stan::math::assign(y, integrate_ode_rk45(ode_SIR_functor__(), y0, 0, rep_array(t, 1), theta, rep_array(0.0, 0), rep_array(1, 1), pstream__, 1.0E-10, 1.0E-10, 1.0E3));
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
file73bd1013dd8a.cpp: In instantiation of ‘typename boost::math::tools::promote_args<T1, T2, T3, T4>::type model73bd1c443702_SIR_namespace::sir_process(const T0__&, const T1__&, const T2__&, const T3__&, std::ostream*) [with T0__ = int; T1__ = double; T2__ = double; T3__ = double; typename boost::math::tools::promote_args<T1, T2, T3, T4>::type = double; std::ostream = std::basic_ostream<char>]’:
file73bd1013dd8a.cpp:528:40: required from ‘T__ model73bd1c443702_SIR_namespace::model73bd1c443702_SIR::log_prob(std::vector<T_l>&, std::vector<int>&, std::ostream*) const [with bool propto__ = false; bool jacobian__ = false; T__ = double; std::ostream = std::basic_ostream<char>]’
/home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/src/stan/services/optimize/newton.hpp:61:14: required from ‘int stan::services::optimize::newton(Model&, stan::io::var_context&, unsigned int, unsigned int, double, int, bool, stan::callbacks::interrupt&, stan::callbacks::logger&, stan::callbacks::writer&, stan::callbacks::writer&) [with Model = model73bd1c443702_SIR_namespace::model73bd1c443702_SIR]’
/home/ben/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/stan_fit.hpp:488:41: required from ‘int rstan::{anonymous}::command(rstan::stan_args&, Model&, Rcpp::List&, const std::vector<long unsigned int>&, const std::vector<std::__cxx11::basic_string<char> >&, RNG_t&) [with Model = model73bd1c443702_SIR_namespace::model73bd1c443702_SIR; RNG_t = boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399> >; Rcpp::List = Rcpp::Vector<19>]’
/home/ben/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/stan_fit.hpp:1201:18: required from ‘SEXPREC* rstan::stan_fit<Model, RNG_t>::call_sampler(SEXP) [with Model = model73bd1c443702_SIR_namespace::model73bd1c443702_SIR; RNG_t = boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399> >; SEXP = SEXPREC*]’
file73bd1013dd8a.cpp:746:114: required from here
file73bd1013dd8a.cpp:154:49: error: no matching function for call to ‘integrate_ode_rk45(model73bd1c443702_SIR_namespace::ode_SIR_functor__, std::vector<double>&, int, std::vector<int>, std::vector<double>&, std::vector<double>, std::vector<int>, std::ostream*&, double, double, double)’
In file included from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/arr.hpp:46,
from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat.hpp:344,
from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:12,
from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math.hpp:4,
from /home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file73bd1013dd8a.cpp:8:
/home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:70:1: note: candidate: ‘template<class F, class T1, class T2> std::vector<std::vector<typename stan::return_type<T_shared_param, T_job_param>::type> > stan::math::integrate_ode_rk45(const F&, const std::vector<T>&, double, const std::vector<double>&, const std::vector<T_l>&, const std::vector<double>&, const std::vector<int>&, std::ostream*, double, double, int)’
integrate_ode_rk45(const F& f, const std::vector<T1>& y0, double t0,
^~~~~~~~~~~~~~~~~~
/home/ben/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:70:1: note: template argument deduction/substitution failed:
file73bd1013dd8a.cpp:154:49: note: cannot convert ‘stan::math::rep_array(const T&, int) [with T = int](1)’ (type ‘std::vector<int>’) to type ‘const std::vector<double>&’
stan::math::assign(y, integrate_ode_rk45(ode_SIR_functor__(), y0, 0, rep_array(t, 1), theta, rep_array(0.0, 0), rep_array(1, 1), pstream__, 1.0E-10, 1.0E-10, 1.0E3));
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~