Statistics

  1. Mean, Standard Deviation and Variance

  2. Absolute deviation

  3. Higher moments (skewness and kurtosis)

  4. Autocorrelation

  5. Covariance

  6. Correlation

  7. Weighted samples

  8. Maximum and minimum values

  9. Median and percentiles

  10. Examples

Mean, Standard Deviation and Variance









Absolute deviation


Higher moments (skewness and kurtosis)



Autocorrelation


Covariance


Correlation


Weighted samples


Maximum and Minimum values







Median and Percentiles



Example

#!/usr/bin/env ruby
require 'gsl'

ary =  [17.2, 18.1, 16.5, 18.3, 12.6]
data = Vector.alloc(ary)
mean     = data.mean()
variance = data.stats_variance()
largest  = data.stats_max()
smallest = data.stats_min()

printf("The dataset is %g, %g, %g, %g, %g\n",
       data[0], data[1], data[2], data[3], data[4]);

printf("The sample mean is %g\n", mean);
printf("The estimated variance is %g\n", variance);
printf("The largest value is %g\n", largest);
printf("The smallest value is %g\n", smallest);

prev next

Reference index top