1 #ifndef STAN_MATH_PRIM_MAT_FUN_SD_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_SD_HPP
7 #include <boost/math/tools/promotion.hpp>
21 typename boost::math::tools::promote_args<T>::type
22 sd(
const std::vector<T>& v) {
24 if (v.size() == 1)
return 0.0;
34 template <
typename T,
int R,
int C>
36 typename boost::math::tools::promote_args<T>::type
37 sd(
const Eigen::Matrix<T, R, C>& m) {
40 if (m.size() == 1)
return 0.0;
fvar< T > sqrt(const fvar< T > &x)
bool check_nonzero_size(const char *function, const char *name, const T_y &y)
Return true if the specified matrix/vector is of non-zero size.
boost::math::tools::promote_args< T >::type sd(const std::vector< T > &v)
Returns the unbiased sample standard deviation of the coefficients in the specified column vector...
boost::math::tools::promote_args< T >::type variance(const std::vector< T > &v)
Returns the sample variance (divide by length - 1) of the coefficients in the specified standard vect...