Hello,
I have been trying to fit models using cmdstan and cmdstanr on a Linux server.
cmdstanr version 0.7.1
cmdstan version 2.30.1
Operating System: Linux Centos7
I can get the Bernoulli example (see attached code with reproducible example) to compile and run successfully. However, when I try to implement the schools example (see attached code with reproducible example) the model compiles and starts sampling but ends unexpectedly after a few iterations. I can’t understand why the Bernoulli model would work while the schools model wouldn’t. Does anybody have any suggestions as to why that may be or what I should check to try and diagnose this? I am copying the output that I get when I compile and run the failing model (warnings occurring during compilation seem to be the same with both the model that works and the model that does not work). I have seen a few posts with what appear to be very similar issues on the forum but none of them seems to have found a solution.
CmdStan path set to: /modeling/spack/opt/spack/linux-centos7-haswell/gcc-12.2.0/cmdstan-2.30.1-6flytnlf npq7xf6xldbnkxstwkljxmy7
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/multi_array/multi_array_ref.hpp:32,
from stan/lib/stan_math/lib/boost_1.78.0/boost/multi_array.hpp:34,
from stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/algebra/multi_array_alge bra.hpp:22,
from stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint.hpp:63,
from stan/lib/stan_math/stan/math/prim/functor/ode_rk45.hpp:9,
from stan/lib/stan_math/stan/math/prim/functor/integrate_ode_rk45.hpp:6,
from stan/lib/stan_math/stan/math/prim/functor.hpp:14,
from stan/lib/stan_math/stan/math/rev/fun.hpp:196,
from stan/lib/stan_math/stan/math/rev.hpp:10,
from stan/lib/stan_math/stan/math.hpp:19,
from stan/src/stan/model/model_header.hpp:4,
from /tmp/RtmplSlamc/model-a6ed4d92e1b1.hpp:3:
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:180:45: warning: ‘template<class _Arg, class _ Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
180 | : public boost::functional::detail::unary_function<typename unary_traits::ar gument_type,bool>
| ^~~~~~~~~~~~~~
In file included from /modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g 6x5lksmvapqw3dnkce3p/lib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/string:48,
from /modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g 6x5lksmvapqw3dnkce3p/lib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/locale_clas ses.h:40,
from /modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g 6x5lksmvapqw3dnkce3p/lib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/ios_base.h: 41,
from /modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g 6x5lksmvapqw3dnkce3p/lib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/ios:42,
from /modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g 6x5lksmvapqw3dnkce3p/lib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/istream:38,
from /modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g 6x5lksmvapqw3dnkce3p/lib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/sstream:38,
from /modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g 6x5lksmvapqw3dnkce3p/lib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/complex:45,
from stan/lib/stan_math/lib/eigen_3.3.9/Eigen/Core:96,
from stan/lib/stan_math/lib/eigen_3.3.9/Eigen/Dense:1,
from stan/lib/stan_math/stan/math/prim/fun/Eigen.hpp:22,
from stan/lib/stan_math/stan/math/rev.hpp:4:
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:117:12: note: decl ared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
stan/
lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:214:45: warning: ‘template<class _Arg1, class _Arg2 , class _Result> struct std::binary_function’ is deprecated [-Wdeprecated-declarations]
214 | : public boost::functional::detail::binary_function<
| ^~~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:131:12: note: decl ared here
131 | struct binary_function
| ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:252:45: warning: ‘template<class _Arg, class _ Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
252 | : public boost::functional::detail::unary_function<
| ^~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:117:12: note: decl ared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:299:45: warning: ‘template<class _Arg, class _ Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
299 | : public boost::functional::detail::unary_function<
| ^~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:117:12: note: decl ared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:345:57: warning: ‘template<class _Arg, class _ Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
345
| class mem_fun_t : public boost::functional::detail::unary_function<T*, S>
| ^~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:117:12: note: decl ared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:361:58: warning: ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’ is deprecated [-Wdeprecated-declarations]
361 | class mem_fun1_t : public boost::functional::detail::binary_function<T*, A, S>
| ^~~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:131:12: note: decl ared here
131 | struct binary_function
| ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:377:63: warning: ‘template<class _Arg, class _ Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
377 | class const_mem_fun_t : public boost::functional::detail::unary_function<const T*, S>
| ^~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:117:12: note: decl ared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:393:64: warning: ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’ is deprecated [-Wdeprecated-declarations]
393 | class const_mem_fun1_t : public boost::functional::detail::binary_function<const T*, A, S>
| ^~~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:131:12: note: decl ared here
131 | struct binary_function
| ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boo
st_1.78.0/boost/functional.hpp:438:61: warning: ‘template<class _Arg, class Result> struct std::unary function’ is deprecated [-Wdeprecated-declarations]
438 | class mem_fun_ref_t : public boost::functional::detail::unary_function<T&, S>
| ^~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:117:12: note: decl ared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:454:62: warning: ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’ is deprecated [-Wdeprecated-declarations]
454 | class mem_fun1_ref_t : public boost::functional::detail::binary_function<T&, A, S>
| ^~~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:131:12: note: decl ared here
131 | struct binary_function
| ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:470:67: warning: ‘template<class _Arg, class _ Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
470 | class const_mem_fun_ref_t : public boost::functional::detail::unary_function<const T&, S>
| ^~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:117:12: note: decl ared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:487:68: warni
ng: ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’ is deprecated [-Wde precated-declarations]
487 | class const_mem_fun1_ref_t : public boost::functional::detail::binary_function<const T&, A, S>
| ^~~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:131:12: note: decl ared here
131 | struct binary_function
| ^~~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:533:73: warning: ‘template<class _Arg, class _ Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
533 | class pointer_to_unary_function : public boost::functional::detail::unary_function<Arg,Resu lt>
| ^~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:117:12: note: decl ared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
stan/lib/stan_math/lib/boost_1.78.0/boost/functional.hpp:557:74: warning: ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’ is deprecated [-Wdeprecated-declarations]
557 | class pointer_to_binary_function : public boost::functional::detail::binary_function<Arg1,A rg2,Result>
| ^~~~~~~~~~~~~~~
/modeling/spack/opt/spack/linux-centos7-haswell/gcc-4.8.5/gcc-12.2.0-jvrrfd27hm6g6x5lksmvapqw3dnkce3p/l ib/gcc/x86_64-pc-linux-gnu/12.2.0/…/…/…/…/include/c++/12.2.0/bits/stl_function.h:131:12: note: decl ared here
131 | struct binary_function
| ^~~~~~~~~~~~~~~
Running MCMC with 1 chain…
Chain 1 Iteration: 1 / 1000 [ 0%] (Warmup)
Warning: Chain 1 finished unexpectedly!
Warning message:
No chains finished successfully. Unable to retrieve the fit.
Error: No chains finished successfully. Unable to retrieve the draws.
Execution halted
schools.R (360 Bytes)
bernoulli.R (295 Bytes)
bernoulli.stan (244 Bytes)
schools.stan (366 Bytes)