## File: Absolute-deviation.html

package info (click to toggle)
gsl-ref-html 2.3-1
• area: non-free
• in suites: bullseye, buster, sid
• size: 6,876 kB
• ctags: 4,574
• sloc: makefile: 35
 file content (108 lines) | stat: -rw-r--r-- 5,338 bytes parent folder | download
 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108  GNU Scientific Library – Reference Manual: Absolute deviation

21.2 Absolute deviation

Function: double gsl_stats_absdev (const double data[], size_t stride, size_t n)

This function computes the absolute deviation from the mean of data, a dataset of length n with stride stride. The absolute deviation from the mean is defined as,

absdev  = (1/N) \sum |x_i - \Hat\mu|

where x_i are the elements of the dataset data. The absolute deviation from the mean provides a more robust measure of the width of a distribution than the variance. This function computes the mean of data via a call to gsl_stats_mean.

Function: double gsl_stats_absdev_m (const double data[], size_t stride, size_t n, double mean)

This function computes the absolute deviation of the dataset data relative to the given value of mean,

absdev  = (1/N) \sum |x_i - mean|

This function is useful if you have already computed the mean of data (and want to avoid recomputing it), or wish to calculate the absolute deviation relative to another value (such as zero, or the median).