I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 0.20
sub units 1.00
+
0

Standard Deviation

Calculates the standard deviation of a given population.
Controller: CodeCogs

Dependents

Info

Interface

C++

Stdev

 
template<class T> doublestdevintn
T*data
booltotal = false )
The standard deviation \inline  \sigma is defined by the square root of the bias-corrected variance

Physical scientists often use the term root-mean-square as a synonym for standard deviation when they refer to the square root of the mean squared deviation of a quantity from a given baseline. The standard deviation arises naturally in mathematical statistics through its definition in terms of the second central moment. However, a more natural but much less frequently encountered measure of average deviation from the mean that is used in descriptive statistics is the so-called mean deviation.

If the value of the boolean argument total is true, then the standard deviation is computed using the following formula:

References

MathWorld, http:mathworld.wolfram.com/StandardDeviation.html

Example 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

nthe size of the population
datathe actual population data given as an array
totalDefault 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.