diff --git a/src/stan/services/pathfinder/psis.hpp b/src/stan/services/pathfinder/psis.hpp index 1684daf5cf..b4da255063 100644 --- a/src/stan/services/pathfinder/psis.hpp +++ b/src/stan/services/pathfinder/psis.hpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include namespace stan { namespace services { @@ -261,10 +263,13 @@ inline Eigen::Array psis_weights( llr_weights.coeffRef(idx.coeff(i)) = smoothed.first.coeff(i); } if (smoothed.second > 0.7) { - logger.warn(std::string("Pareto k value (") + - std::to_string(smoothed.second) + ") is greater than 0.7." - " Importance resampling was not able to improve the approximation," - " which may indicate that the approximation itself is poor."); + std::stringstream s; + s << "Pareto k value (" << std::setprecision(2) << smoothed.second + << ") is greater than 0.7. Importance resampling was not able to " + << "improve the approximation, which may indicate that the " + << "approximation itself is poor."; + + logger.warn(s.str()); } } }