Statistics › Moments ›
Standard Deviation
Calculates the standard deviation of a given population.
Controller: CodeCogs
Contents
Dependents
Interface
C++
Stdev
template<class T> doublestdev( | int | n | |
T* | data | ||
bool | total = false | ) |
References
MathWorld, http:mathworld.wolfram.com/StandardDeviation.htmlExample 1
#include <codecogs/statistics/moments/standard_deviation.h> #include <iostream> int main() { double x[5] = {2.5 , 6.2 , 8.0 , 9.6 , 3.8}; double dev = Stats::Moments::stdev<double>(5, x); std::cout << "The population standard deviation is: " << dev << std::endl; return 0; }
Output:The population standard deviation is: 2.9192
Parameters
n the size of the population data the actual population data given as an array total Default value = false
Returns
- the standard deviation mean of a given population
Authors
- Anca Filibiu (August 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.