Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ variance() [4/7]

template<typename StdVec , require_std_vector_t< StdVec > * = nullptr, require_not_vt_var< StdVec > * = nullptr>
value_type_t< StdVec > stan::math::variance ( const StdVec &  v)
inline

Returns the sample variance (divide by length - 1) of the coefficients in the specified standard vector.

Template Parameters
StdVecA standard library vector that does not contain a var.
Parameters
vspecified vector
Returns
sample variance of vector
Exceptions
<code>std::invalid_argument</code>if the vector has size zero

Definition at line 46 of file variance.hpp.