Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
write_error_msg.hpp
Go to the documentation of this file.
1 #ifndef STAN__COMMON__WRITE_ERROR_MSG_HPP
2 #define STAN__COMMON__WRITE_ERROR_MSG_HPP
3 
4 #include <ostream>
5 #include <stdexcept>
6 
7 namespace stan {
8 
9  namespace common {
10 
11  void write_error_msg(std::ostream* error_stream,
12  const std::exception& e) {
13 
14  if (!error_stream) return;
15 
16  *error_stream << std::endl
17  << "Informational Message: The current Metropolis proposal is about to be"
18  << " rejected because of the following issue:"
19  << std::endl
20  << e.what() << std::endl
21  << "If this warning occurs sporadically, such as for highly constrained"
22  << " variable types like covariance matrices, then the sampler is fine,"
23  << std::endl
24  << "but if this warning occurs often then your model may be either"
25  << " severely ill-conditioned or misspecified."
26  << std::endl;
27  }
28 
29 
30  } // namespace common
31 
32 } // namespace stan
33 
34 #endif
void write_error_msg(std::ostream *error_stream, const std::exception &e)
double e()
Return the base of the natural logarithm.
Definition: constants.hpp:86

     [ Stan Home Page ] © 2011–2014, Stan Development Team.