Statistics › Moments ›
Skewness
Calculates the skewness of a given set of data.
Controller: CodeCogs
Contents
Dependents
Interface
C++
Skewness
template<class T> doubleskewness( | int | n | |
T* | data | ) |
Example 1
#include <codecogs/statistics/moments/skewness.h> #include <iostream> int main() { float x[5] = {3.4 , 7.1 , 1.5 , 8.6 , 4.9}; double skew = Stats::Moments::skewness<float>(5, x); std::cout << "The population skewness is: " << skew << std::endl; return 0; }
Output:The population skewness is:-0.0107687
Parameters
n the size of the population data the actual population data given as an array
Returns
- the skewness of the given set of data
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.