Stan Model Wont Compile
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.1k
- Forks
- 266
- Avg merge
- 2h 56m
- Merged PRs (30d)
- 1
Description
Summary:
I am trying to run my Stan code in an RStudio R Markdown file, but it will not compile and instead produces an error.
Description:
I am trying to run my Stan code in an RStudio R Markdown file, but it will not compile and instead produces an error. I have tried it on two different Mac machines, but the same error is produced.
My code is as follows:
data{
int<lower=1> n; // number of observations
int<lower=1> p; // number of predictors
matrix[n, p] x; // design matrix
vector[n] y; // responses
}
transformed data{
matrix [n, p] Q_ast;
matrix [p, p] R_ast;
matrix [p, p] R_ast_inverse;
Q_ast = qr_Q(x)[,1:p] * sqrt(n-1);
R_ast = qr_R(x)[1:p,] / sqrt(n-1);
R_ast_inverse = inverse(R_ast);
}
parameters{
real<lower=-10, upper=10> log_sigma;
real alpha; // intercept
vector[p] theta; // regression coefficients for predictors
}
transformed parameters{
real sigma;
vector[p] beta;
sigma = exp(log_sigma);
beta = R_ast_inverse * theta;
}
model{
y ~ normal(alpha + Q_ast * theta, sigma);
}
Reproducible Steps:
I simply try to run the aforementioned code.
Current Output:
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:12:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/var.hpp:7:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/math/tools/config.hpp:13:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/config.hpp:39:
/usr/local/lib/R/3.5/site-library/BH/include/boost/config/compiler/clang.hpp:200:11: warning: 'BOOST_NO_CXX11_RVALUE_REFERENCES' macro redefined [-Wmacro-redefined]
# define BOOST_NO_CXX11_RVALUE_REFERENCES
^
<command line>:6:9: note: previous definition is here
#define BOOST_NO_CXX11_RVALUE_REFERENCES 1
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:14:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Dense:1:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Core:531:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:14:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Dense:2:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/LU:47:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:14:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Dense:3:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Cholesky:12:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Jacobi:29:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:14:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Dense:3:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Cholesky:43:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:14:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Dense:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/QR:17:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Householder:27:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:14:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Dense:5:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/SVD:48:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:14:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Dense:6:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Geometry:58:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:14:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Dense:7:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Eigenvalues:58:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:36:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/operator_unary_plus.hpp:7:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/scal/fun/constants.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/math/constants/constants.hpp:13:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/math/tools/convert_from_string.hpp:15:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/lexical_cast.hpp:32:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/lexical_cast/try_lexical_convert.hpp:42:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/lexical_cast/detail/converter_lexical.hpp:52:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/container/container_fwd.hpp:61:
/usr/local/lib/R/3.5/site-library/BH/include/boost/container/detail/std_fwd.hpp:27:1: warning: inline namespaces are a C++11 feature [-Wc++11-inline-namespace]
BOOST_MOVE_STD_NS_BEG
^
/usr/local/lib/R/3.5/site-library/BH/include/boost/move/detail/std_ns_begin.hpp:18:34: note: expanded from macro 'BOOST_MOVE_STD_NS_BEG'
#define BOOST_MOVE_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/__config:390:52: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat.hpp:83:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Sparse:26:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/SparseCore:66:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat.hpp:83:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Sparse:27:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/OrderingMethods:71:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat.hpp:83:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Sparse:29:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/SparseCholesky:43:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat.hpp:83:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Sparse:32:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/SparseQR:35:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:12:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat.hpp:83:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/Sparse:33:
In file included from /usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/IterativeLinearSolvers:46:
/usr/local/lib/R/3.5/site-library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
filed2ce2cffb55a.cpp:142:228: error: call to 'sqrt' is ambiguous
stan::math::assign(Q_ast, multiply(stan::model::rvalue(qr_Q(x), stan::model::cons_list(stan::model::index_omni(), stan::model::cons_list(stan::model::index_min_max(1, p), stan::model::nil_index_list())), "qr_Q(x)"),sqrt((n - 1))));
^~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:970:1: note: candidate function [with _A1 = int]
sqrt(_A1 __lcpp_x) _NOEXCEPT {return ::sqrt((double)__lcpp_x);}
^
/usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/sqrt.hpp:32:5: note: candidate function [with T = int]
sqrt(const T& x) {
^
/usr/include/math.h:447:15: note: candidate function
extern double sqrt(double);
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:963:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return ::sqrtf(__lcpp_x);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:964:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
^
/usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/scal/fun/sqrt.hpp:50:16: note: candidate function
inline var sqrt(const var& a) {
^
filed2ce2cffb55a.cpp:144:226: error: call to 'sqrt' is ambiguous
stan::math::assign(R_ast, divide(stan::model::rvalue(qr_R(x), stan::model::cons_list(stan::model::index_min_max(1, p), stan::model::cons_list(stan::model::index_omni(), stan::model::nil_index_list())), "qr_R(x)"),sqrt((n - 1))));
^~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:970:1: note: candidate function [with _A1 = int]
sqrt(_A1 __lcpp_x) _NOEXCEPT {return ::sqrt((double)__lcpp_x);}
^
/usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/prim/mat/fun/sqrt.hpp:32:5: note: candidate function [with T = int]
sqrt(const T& x) {
^
/usr/include/math.h:447:15: note: candidate function
extern double sqrt(double);
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:963:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return ::sqrtf(__lcpp_x);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:964:46: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
^
/usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/scal/fun/sqrt.hpp:50:16: note: candidate function
inline var sqrt(const var& a) {
^
In file included from filed2ce2cffb55a.cpp:537:
In file included from /usr/local/lib/R/3.5/site-library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /usr/local/lib/R/3.5/site-library/rstan/include/rstan/stan_fit.hpp:36:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/services/optimize/bfgs.hpp:11:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/optimization/bfgs.hpp:9:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/optimization/lbfgs_update.hpp:6:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/circular_buffer.hpp:54:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/circular_buffer/details.hpp:20:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/move/move.hpp:30:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/move/iterator.hpp:27:
/usr/local/lib/R/3.5/site-library/BH/include/boost/move/detail/iterator_traits.hpp:29:1: warning: inline namespaces are a C++11 feature [-Wc++11-inline-namespace]
BOOST_MOVE_STD_NS_BEG
^
/usr/local/lib/R/3.5/site-library/BH/include/boost/move/detail/std_ns_begin.hpp:18:34: note: expanded from macro 'BOOST_MOVE_STD_NS_BEG'
#define BOOST_MOVE_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/__config:390:52: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
^
16 warnings and 2 errors generated.
make: *** [filed2ce2cffb55a.o] Error 1
ERROR(s) during compilation: source code errors or compiler configuration errors!
Program source:
1:
2: // includes from the plugin
3:
4:
5: // user includes
6: #define STAN__SERVICES__COMMAND_HPP// Code generated by Stan version 2.17.0
7:
8: #include <stan/model/model_header.hpp>
9:
10: namespace modeld2ce7662428e_stan_d2ce7301ba1e_namespace {
11:
12: using std::istream;
13: using std::string;
14: using std::stringstream;
15: using std::vector;
16: using stan::io::dump;
17: using stan::math::lgamma;
18: using stan::model::prob_grad;
19: using namespace stan::math;
20:
21: typedef Eigen::Matrix<double,Eigen::Dynamic,1> vector_d;
22: typedef Eigen::Matrix<double,1,Eigen::Dynamic> row_vector_d;
23: typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> matrix_d;
24:
25: static int current_statement_begin__;
26:
27: stan::io::program_reader prog_reader__() {
28: stan::io::program_reader reader;
29: reader.add_event(0, 0, "start", "modeld2ce7662428e_stan_d2ce7301ba1e");
30: reader.add_event(32, 32, "end", "modeld2ce7662428e_stan_d2ce7301ba1e");
31: return reader;
32: }
33:
34: class modeld2ce7662428e_stan_d2ce7301ba1e : public prob_grad {
35: private:
36: int n;
37: int p;
38: matrix_d x;
39: vector_d y;
40: matrix_d Q_ast;
41: matrix_d R_ast;
42: matrix_d R_ast_inverse;
43: public:
44: modeld2ce7662428e_stan_d2ce7301ba1e(stan::io::var_context& context__,
45: std::ostream* pstream__ = 0)
46: : prob_grad(0) {
47: ctor_body(context__, 0, pstream__);
48: }
49:
50: modeld2ce7662428e_stan_d2ce7301ba1e(stan::io::var_context& context__,
51: unsigned int random_seed__,
52: std::ostream* pstream__ = 0)
53: : prob_grad(0) {
54: ctor_body(context__, random_seed__, pstream__);
55: }
56:
57: void ctor_body(stan::io::var_context& context__,
58: unsigned int random_seed__,
59: std::ostream* pstream__) {
60: boost::ecuyer1988 base_rng__ =
61: stan::services::util::create_rng(random_seed__, 0);
62: (void) base_rng__; // suppress unused var warning
63:
64: current_statement_begin__ = -1;
65:
66: static const char* function__ = "modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e";
67: (void) function__; // dummy to suppress unused var warning
68: size_t pos__;
69: (void) pos__; // dummy to suppress unused var warning
70: std::vector<int> vals_i__;
71: std::vector<double> vals_r__;
72: double DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
73: (void) DUMMY_VAR__; // suppress unused var warning
74:
75: // initialize member variables
76: try {
77: current_statement_begin__ = 2;
78: context__.validate_dims("data initialization", "n", "int", context__.to_vec());
79: n = int(0);
80: vals_i__ = context__.vals_i("n");
81: pos__ = 0;
82: n = vals_i__[pos__++];
83: current_statement_begin__ = 3;
84: context__.validate_dims("data initialization", "p", "int", context__.to_vec());
85: p = int(0);
86: vals_i__ = context__.vals_i("p");
87: pos__ = 0;
88: p = vals_i__[pos__++];
89: current_statement_begin__ = 4;
90: validate_non_negative_index("x", "n", n);
91: validate_non_negative_index("x", "p", p);
92: context__.validate_dims("data initialization", "x", "matrix_d", context__.to_vec(n,p));
93: validate_non_negative_index("x", "n", n);
94: validate_non_negative_index("x", "p", p);
95: x = matrix_d(static_cast<Eigen::VectorXd::Index>(n),static_cast<Eigen::VectorXd::Index>(p));
96: vals_r__ = context__.vals_r("x");
97: pos__ = 0;
98: size_t x_m_mat_lim__ = n;
99: size_t x_n_mat_lim__ = p;
100: for (size_t n_mat__ = 0; n_mat__ < x_n_mat_lim__; ++n_mat__) {
101: for (size_t m_mat__ = 0; m_mat__ < x_m_mat_lim__; ++m_mat__) {
102: x(m_mat__,n_mat__) = vals_r__[pos__++];
103: }
104: }
105: current_statement_begin__ = 5;
106: validate_non_negative_index("y", "n", n);
107: context__.validate_dims("data initialization", "y", "vector_d", context__.to_vec(n));
108: validate_non_negative_index("y", "n", n);
109: y = vector_d(static_cast<Eigen::VectorXd::Index>(n));
110: vals_r__ = context__.vals_r("y");
111: pos__ = 0;
112: size_t y_i_vec_lim__ = n;
113: for (size_t i_vec__ = 0; i_vec__ < y_i_vec_lim__; ++i_vec__) {
114: y[i_vec__] = vals_r__[pos__++];
115: }
116:
117: // validate, data variables
118: current_statement_begin__ = 2;
119: check_greater_or_equal(function__,"n",n,1);
120: current_statement_begin__ = 3;
121: check_greater_or_equal(function__,"p",p,1);
122: current_statement_begin__ = 4;
123: current_statement_begin__ = 5;
124: // initialize data variables
125: current_statement_begin__ = 9;
126: validate_non_negative_index("Q_ast", "n", n);
127: validate_non_negative_index("Q_ast", "p", p);
128: Q_ast = matrix_d(static_cast<Eigen::VectorXd::Index>(n),static_cast<Eigen::VectorXd::Index>(p));
129: stan::math::fill(Q_ast,DUMMY_VAR__);
130: current_statement_begin__ = 10;
131: validate_non_negative_index("R_ast", "p", p);
132: validate_non_negative_index("R_ast", "p", p);
133: R_ast = matrix_d(static_cast<Eigen::VectorXd::Index>(p),static_cast<Eigen::VectorXd::Index>(p));
134: stan::math::fill(R_ast,DUMMY_VAR__);
135: current_statement_begin__ = 11;
136: validate_non_negative_index("R_ast_inverse", "p", p);
137: validate_non_negative_index("R_ast_inverse", "p", p);
138: R_ast_inverse = matrix_d(static_cast<Eigen::VectorXd::Index>(p),static_cast<Eigen::VectorXd::Index>(p));
139: stan::math::fill(R_ast_inverse,DUMMY_VAR__);
140:
141: current_statement_begin__ = 12;
142: stan::math::assign(Q_ast, multiply(stan::model::rvalue(qr_Q(x), stan::model::cons_list(stan::model::index_omni(), stan::model::cons_list(stan::model::index_min_max(1, p), stan::model::nil_index_list())), "qr_Q(x)"),sqrt((n - 1))));
143: current_statement_begin__ = 13;
144: stan::math::assign(R_ast, divide(stan::model::rvalue(qr_R(x), stan::model::cons_list(stan::model::index_min_max(1, p), stan::model::cons_list(stan::model::index_omni(), stan::model::nil_index_list())), "qr_R(x)"),sqrt((n - 1))));
145: current_statement_begin__ = 14;
146: stan::math::assign(R_ast_inverse, inverse(R_ast));
147:
148: // validate transformed data
149: current_statement_begin__ = 9;
150: current_statement_begin__ = 10;
151: current_statement_begin__ = 11;
152:
153: // validate, set parameter ranges
154: num_params_r__ = 0U;
155: param_ranges_i__.clear();
156: current_statement_begin__ = 18;
157: ++num_params_r__;
158: current_statement_begin__ = 19;
159: ++num_params_r__;
160: current_statement_begin__ = 20;
161: validate_non_negative_index("theta", "p", p);
162: num_params_r__ += p;
163: } catch (const std::exception& e) {
164: stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
165: // Next line prevents compiler griping about no return
166: throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
167: }
168: }
169:
170: ~modeld2ce7662428e_stan_d2ce7301ba1e() { }
171:
172:
173: void transform_inits(const stan::io::var_context& context__,
174: std::vector<int>& params_i__,
175: std::vector<double>& params_r__,
176: std::ostream* pstream__) const {
177: stan::io::writer<double> writer__(params_r__,params_i__);
178: size_t pos__;
179: (void) pos__; // dummy call to supress warning
180: std::vector<double> vals_r__;
181: std::vector<int> vals_i__;
182:
183: if (!(context__.contains_r("log_sigma")))
184: throw std::runtime_error("variable log_sigma missing");
185: vals_r__ = context__.vals_r("log_sigma");
186: pos__ = 0U;
187: context__.validate_dims("initialization", "log_sigma", "double", context__.to_vec());
188: double log_sigma(0);
189: log_sigma = vals_r__[pos__++];
190: try {
191: writer__.scalar_lub_unconstrain(-(10),10,log_sigma);
192: } catch (const std::exception& e) {
193: throw std::runtime_error(std::string("Error transforming variable log_sigma: ") + e.what());
194: }
195:
196: if (!(context__.contains_r("alpha")))
197: throw std::runtime_error("variable alpha missing");
198: vals_r__ = context__.vals_r("alpha");
199: pos__ = 0U;
200: context__.validate_dims("initialization", "alpha", "double", context__.to_vec());
201: double alpha(0);
202: alpha = vals_r__[pos__++];
203: try {
204: writer__.scalar_unconstrain(alpha);
205: } catch (const std::exception& e) {
206: throw std::runtime_error(std::string("Error transforming variable alpha: ") + e.what());
207: }
208:
209: if (!(context__.contains_r("theta")))
210: throw std::runtime_error("variable theta missing");
211: vals_r__ = context__.vals_r("theta");
212: pos__ = 0U;
213: validate_non_negative_index("theta", "p", p);
214: context__.validate_dims("initialization", "theta", "vector_d", context__.to_vec(p));
215: vector_d theta(static_cast<Eigen::VectorXd::Index>(p));
216: for (int j1__ = 0U; j1__ < p; ++j1__)
217: theta(j1__) = vals_r__[pos__++];
218: try {
219: writer__.vector_unconstrain(theta);
220: } catch (const std::exception& e) {
221: throw std::runtime_error(std::string("Error transforming variable theta: ") + e.what());
222: }
223:
224: params_r__ = writer__.data_r();
225: params_i__ = writer__.data_i();
226: }
227:
228: void transform_inits(const stan::io::var_context& context,
229: Eigen::Matrix<double,Eigen::Dynamic,1>& params_r,
230: std::ostream* pstream__) const {
231: std::vector<double> params_r_vec;
232: std::vector<int> params_i_vec;
233: transform_inits(context, params_i_vec, params_r_vec, pstream__);
234: params_r.resize(params_r_vec.size());
235: for (int i = 0; i < params_r.size(); ++i)
236: params_r(i) = params_r_vec[i];
237: }
238:
239:
240: template <bool propto__, bool jacobian__, typename T__>
241: T__ log_prob(vector<T__>& params_r__,
242: vector<int>& params_i__,
243: std::ostream* pstream__ = 0) const {
244:
245: T__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
246: (void) DUMMY_VAR__; // suppress unused var warning
247:
248: T__ lp__(0.0);
249: stan::math::accumulator<T__> lp_accum__;
250:
251: try {
252: // model parameters
253: stan::io::reader<T__> in__(params_r__,params_i__);
254:
255: T__ log_sigma;
256: (void) log_sigma; // dummy to suppress unused var warning
257: if (jacobian__)
258: log_sigma = in__.scalar_lub_constrain(-(10),10,lp__);
259: else
260: log_sigma = in__.scalar_lub_constrain(-(10),10);
261:
262: T__ alpha;
263: (void) alpha; // dummy to suppress unused var warning
264: if (jacobian__)
265: alpha = in__.scalar_constrain(lp__);
266: else
267: alpha = in__.scalar_constrain();
268:
269: Eigen::Matrix<T__,Eigen::Dynamic,1> theta;
270: (void) theta; // dummy to suppress unused var warning
271: if (jacobian__)
272: theta = in__.vector_constrain(p,lp__);
273: else
274: theta = in__.vector_constrain(p);
275:
276:
277: // transformed parameters
278: current_statement_begin__ = 24;
279: T__ sigma;
280: (void) sigma; // dummy to suppress unused var warning
281:
282: stan::math::initialize(sigma, DUMMY_VAR__);
283: stan::math::fill(sigma,DUMMY_VAR__);
284: current_statement_begin__ = 25;
285: validate_non_negative_index("beta", "p", p);
286: Eigen::Matrix<T__,Eigen::Dynamic,1> beta(static_cast<Eigen::VectorXd::Index>(p));
287: (void) beta; // dummy to suppress unused var warning
288:
289: stan::math::initialize(beta, DUMMY_VAR__);
290: stan::math::fill(beta,DUMMY_VAR__);
291:
292:
293: current_statement_begin__ = 26;
294: stan::math::assign(sigma, exp(log_sigma));
295: current_statement_begin__ = 27;
296: stan::math::assign(beta, multiply(R_ast_inverse,theta));
297:
298: // validate transformed parameters
299: if (stan::math::is_uninitialized(sigma)) {
300: std::stringstream msg__;
301: msg__ << "Undefined transformed parameter: sigma";
302: throw std::runtime_error(msg__.str());
303: }
304: for (int i0__ = 0; i0__ < p; ++i0__) {
305: if (stan::math::is_uninitialized(beta(i0__))) {
306: std::stringstream msg__;
307: msg__ << "Undefined transformed parameter: beta" << '[' << i0__ << ']';
308: throw std::runtime_error(msg__.str());
309: }
310: }
311:
312: const char* function__ = "validate transformed params";
313: (void) function__; // dummy to suppress unused var warning
314: current_statement_begin__ = 24;
315: current_statement_begin__ = 25;
316:
317: // model body
318:
319: current_statement_begin__ = 31;
320: lp_accum__.add(normal_log<propto__>(y, add(alpha,multiply(Q_ast,theta)), sigma));
321:
322: } catch (const std::exception& e) {
323: stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
324: // Next line prevents compiler griping about no return
325: throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
326: }
327:
328: lp_accum__.add(lp__);
329: return lp_accum__.sum();
330:
331: } // log_prob()
332:
333: template <bool propto, bool jacobian, typename T_>
334: T_ log_prob(Eigen::Matrix<T_,Eigen::Dynamic,1>& params_r,
335: std::ostream* pstream = 0) const {
336: std::vector<T_> vec_params_r;
337: vec_params_r.reserve(params_r.size());
338: for (int i = 0; i < params_r.size(); ++i)
339: vec_params_r.push_back(params_r(i));
340: std::vector<int> vec_params_i;
341: return log_prob<propto,jacobian,T_>(vec_params_r, vec_params_i, pstream);
342: }
343:
344:
345: void get_param_names(std::vector<std::string>& names__) const {
346: names__.resize(0);
347: names__.push_back("log_sigma");
348: names__.push_back("alpha");
349: names__.push_back("theta");
350: names__.push_back("sigma");
351: names__.push_back("beta");
352: }
353:
354:
355: void get_dims(std::vector<std::vector<size_t> >& dimss__) const {
356: dimss__.resize(0);
357: std::vector<size_t> dims__;
358: dims__.resize(0);
359: dimss__.push_back(dims__);
360: dims__.resize(0);
361: dimss__.push_back(dims__);
362: dims__.resize(0);
363: dims__.push_back(p);
364: dimss__.push_back(dims__);
365: dims__.resize(0);
366: dimss__.push_back(dims__);
367: dims__.resize(0);
368: dims__.push_back(p);
369: dimss__.push_back(dims__);
370: }
371:
372: template <typename RNG>
373: void write_array(RNG& base_rng__,
374: std::vector<double>& params_r__,
375: std::vector<int>& params_i__,
376: std::vector<double>& vars__,
377: bool include_tparams__ = true,
378: bool include_gqs__ = true,
379: std::ostream* pstream__ = 0) const {
380: vars__.resize(0);
381: stan::io::reader<double> in__(params_r__,params_i__);
382: static const char* function__ = "modeld2ce7662428e_stan_d2ce7301ba1e_namespace::write_array";
383: (void) function__; // dummy to suppress unused var warning
384: // read-transform, write parameters
385: double log_sigma = in__.scalar_lub_constrain(-(10),10);
386: double alpha = in__.scalar_constrain();
387: vector_d theta = in__.vector_constrain(p);
388: vars__.push_back(log_sigma);
389: vars__.push_back(alpha);
390: for (int k_0__ = 0; k_0__ < p; ++k_0__) {
391: vars__.push_back(theta[k_0__]);
392: }
393:
394: if (!include_tparams__) return;
395: // declare and define transformed parameters
396: double lp__ = 0.0;
397: (void) lp__; // dummy to suppress unused var warning
398: stan::math::accumulator<double> lp_accum__;
399:
400: double DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
401: (void) DUMMY_VAR__; // suppress unused var warning
402:
403: try {
404: current_statement_begin__ = 24;
405: double sigma(0.0);
406: (void) sigma; // dummy to suppress unused var warning
407:
408: stan::math::initialize(sigma, std::numeric_limits<double>::quiet_NaN());
409: stan::math::fill(sigma,DUMMY_VAR__);
410: current_statement_begin__ = 25;
411: validate_non_negative_index("beta", "p", p);
412: vector_d beta(static_cast<Eigen::VectorXd::Index>(p));
413: (void) beta; // dummy to suppress unused var warning
414:
415: stan::math::initialize(beta, std::numeric_limits<double>::quiet_NaN());
416: stan::math::fill(beta,DUMMY_VAR__);
417:
418:
419: current_statement_begin__ = 26;
420: stan::math::assign(sigma, exp(log_sigma));
421: current_statement_begin__ = 27;
422: stan::math::assign(beta, multiply(R_ast_inverse,theta));
423:
424: // validate transformed parameters
425: current_statement_begin__ = 24;
426: current_statement_begin__ = 25;
427:
428: // write transformed parameters
429: vars__.push_back(sigma);
430: for (int k_0__ = 0; k_0__ < p; ++k_0__) {
431: vars__.push_back(beta[k_0__]);
432: }
433:
434: if (!include_gqs__) return;
435: // declare and define generated quantities
436:
437:
438:
439: // validate generated quantities
440:
441: // write generated quantities
442: } catch (const std::exception& e) {
443: stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
444: // Next line prevents compiler griping about no return
445: throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
446: }
447: }
448:
449: template <typename RNG>
450: void write_array(RNG& base_rng,
451: Eigen::Matrix<double,Eigen::Dynamic,1>& params_r,
452: Eigen::Matrix<double,Eigen::Dynamic,1>& vars,
453: bool include_tparams = true,
454: bool include_gqs = true,
455: std::ostream* pstream = 0) const {
456: std::vector<double> params_r_vec(params_r.size());
457: for (int i = 0; i < params_r.size(); ++i)
458: params_r_vec[i] = params_r(i);
459: std::vector<double> vars_vec;
460: std::vector<int> params_i_vec;
461: write_array(base_rng,params_r_vec,params_i_vec,vars_vec,include_tparams,include_gqs,pstream);
462: vars.resize(vars_vec.size());
463: for (int i = 0; i < vars.size(); ++i)
464: vars(i) = vars_vec[i];
465: }
466:
467: static std::string model_name() {
468: return "modeld2ce7662428e_stan_d2ce7301ba1e";
469: }
470:
471:
472: void constrained_param_names(std::vector<std::string>& param_names__,
473: bool include_tparams__ = true,
474: bool include_gqs__ = true) const {
475: std::stringstream param_name_stream__;
476: param_name_stream__.str(std::string());
477: param_name_stream__ << "log_sigma";
478: param_names__.push_back(param_name_stream__.str());
479: param_name_stream__.str(std::string());
480: param_name_stream__ << "alpha";
481: param_names__.push_back(param_name_stream__.str());
482: for (int k_0__ = 1; k_0__ <= p; ++k_0__) {
483: param_name_stream__.str(std::string());
484: param_name_stream__ << "theta" << '.' << k_0__;
485: param_names__.push_back(param_name_stream__.str());
486: }
487:
488: if (!include_gqs__ && !include_tparams__) return;
489: param_name_stream__.str(std::string());
490: param_name_stream__ << "sigma";
491: param_names__.push_back(param_name_stream__.str());
492: for (int k_0__ = 1; k_0__ <= p; ++k_0__) {
493: param_name_stream__.str(std::string());
494: param_name_stream__ << "beta" << '.' << k_0__;
495: param_names__.push_back(param_name_stream__.str());
496: }
497:
498: if (!include_gqs__) return;
499: }
500:
501:
502: void unconstrained_param_names(std::vector<std::string>& param_names__,
503: bool include_tparams__ = true,
504: bool include_gqs__ = true) const {
505: std::stringstream param_name_stream__;
506: param_name_stream__.str(std::string());
507: param_name_stream__ << "log_sigma";
508: param_names__.push_back(param_name_stream__.str());
509: param_name_stream__.str(std::string());
510: param_name_stream__ << "alpha";
511: param_names__.push_back(param_name_stream__.str());
512: for (int k_0__ = 1; k_0__ <= p; ++k_0__) {
513: param_name_stream__.str(std::string());
514: param_name_stream__ << "theta" << '.' << k_0__;
515: param_names__.push_back(param_name_stream__.str());
516: }
517:
518: if (!include_gqs__ && !include_tparams__) return;
519: param_name_stream__.str(std::string());
520: param_name_stream__ << "sigma";
521: param_names__.push_back(param_name_stream__.str());
522: for (int k_0__ = 1; k_0__ <= p; ++k_0__) {
523: param_name_stream__.str(std::string());
524: param_name_stream__ << "beta" << '.' << k_0__;
525: param_names__.push_back(param_name_stream__.str());
526: }
527:
528: if (!include_gqs__) return;
529: }
530:
531: }; // model
532:
533: }
534:
535: typedef modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e stan_model;
536:
537: #include <rstan/rstaninc.hpp>
538: /**
539: * Define Rcpp Module to expose stan_fit's functions to R.
540: */
541: RCPP_MODULE(stan_fit4modeld2ce7662428e_stan_d2ce7301ba1e_mod){
542: Rcpp::class_<rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e,
543: boost::random::ecuyer1988> >("stan_fit4modeld2ce7662428e_stan_d2ce7301ba1e")
544: // .constructor<Rcpp::List>()
545: .constructor<SEXP, SEXP, SEXP>()
546: // .constructor<SEXP, SEXP>()
547: .method("call_sampler",
548: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::call_sampler)
549: .method("param_names",
550: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::param_names)
551: .method("param_names_oi",
552: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::param_names_oi)
553: .method("param_fnames_oi",
554: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::param_fnames_oi)
555: .method("param_dims",
556: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::param_dims)
557: .method("param_dims_oi",
558: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::param_dims_oi)
559: .method("update_param_oi",
560: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::update_param_oi)
561: .method("param_oi_tidx",
562: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::param_oi_tidx)
563: .method("grad_log_prob",
564: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::grad_log_prob)
565: .method("log_prob",
566: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::log_prob)
567: .method("unconstrain_pars",
568: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::unconstrain_pars)
569: .method("constrain_pars",
570: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::constrain_pars)
571: .method("num_pars_unconstrained",
572: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::num_pars_unconstrained)
573: .method("unconstrained_param_names",
574: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::unconstrained_param_names)
575: .method("constrained_param_names",
576: &rstan::stan_fit<modeld2ce7662428e_stan_d2ce7301ba1e_namespace::modeld2ce7662428e_stan_d2ce7301ba1e, boost::random::ecuyer1988>::constrained_param_names)
577: ;
578: }
579:
580: // declarations
581: extern "C" {
582: SEXP filed2ce2cffb55a( ) ;
583: }
584:
585: // definition
586:
587: SEXP filed2ce2cffb55a( ){
588: return Rcpp::wrap("stan-d2ce7301ba1e");
589: }
590:
591:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:12:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/var.hpp:7:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/math/tools/config.hpp:13:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/config.hpp:39:
/usr/local/lib/R/3.5/site-library/BH/include/boost/config/compiler/clang.
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command '/usr/local/Cellar/r/3.5.0/lib/R/bin/R CMD SHLIB filed2ce2cffb55a.cpp 2> filed2ce2cffb55a.cpp.err.txt' had status 1
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from filed2ce2cffb55a.cpp:8:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core.hpp:12:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5:
In file included from /usr/local/lib/R/3.5/site-library/StanHeaders/include/stan/math/rev/core/var.hpp:7:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/math/tools/config.hpp:13:
In file included from /usr/local/lib/R/3.5/site-library/BH/include/boost/config.hpp:39:
/usr/local/lib/R/3.5/site-library/BH/include/boost/config/compiler/clang.
Expected Output:
I expect for the code to compile with the usual warnings.
RStan Version:
2.17.3
R Version:
"R version 3.5.0 (2018-04-23)"
Operating System:
macOS High Sierra 10.13.3
Session Info
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin17.5.0 (64-bit)
Running under: macOS High Sierra 10.13.3
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
locale:
removed
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] StanHeaders_2.17.2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.16 knitr_1.20 devtools_1.13.5 munsell_0.4.3
[5] colorspace_1.3-2 lattice_0.20-35 R6_2.2.2 rlang_0.2.0
[9] httr_1.3.1 plyr_1.8.4 tools_3.5.0 parallel_3.5.0
[13] grid_3.5.0 gtable_0.2.0 loo_2.0.0 git2r_0.21.0
[17] withr_2.1.2 matrixStats_0.53.1 lazyeval_0.2.1 digest_0.6.15
[21] tibble_1.4.2 rstan_2.17.3 Matrix_1.2-14 gridExtra_2.3
[25] ggplot2_2.2.1 curl_3.2 memoise_1.1.0 inline_0.3.14
[29] pillar_1.2.2 compiler_3.5.0 scales_0.5.0 stats4_3.5.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied Stan chunk in an RStudio R Markdown file and capture the complete compiler output beyond the truncated warnings. No repository file or test is named; done would be a confirmed cause and a reproducible resolution for this environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100