#include <iostream>
#include <cmath>
#include <string>
#include <fstream>
#include <sstream>
#include <o2scl/err_hnd.h>
#include <gsl/gsl_ieee_utils.h>
#include <gsl/gsl_sort.h>
Go to the source code of this file.
Definition in file vec_stats.h.
Functions | |
template<class vec_t > | |
double | vector_mean (size_t n, vec_t &data) |
Compute the mean of the first n elements of a vector. | |
template<class vec_t > | |
double | vector_variance_fmean (size_t n, vec_t &data, double mean) |
Compute variance with specified mean known in advance. | |
template<class vec_t > | |
double | vector_variance (size_t n, vec_t &data, double mean) |
Compute the variance with specified mean. | |
template<class vec_t > | |
double | vector_variance (size_t n, vec_t &data) |
Compute the variance. | |
template<class vec_t > | |
double | vector_stddev_fmean (size_t n, vec_t &data, double mean) |
Standard deviation with specified mean known in advance. | |
template<class vec_t > | |
double | vector_stddev (size_t n, vec_t &data) |
Standard deviation with specified mean. | |
template<class vec_t > | |
double | vector_stddev (size_t n, vec_t &data, double mean) |
Standard deviation with specified mean. | |
template<class vec_t > | |
double | vector_absdev (size_t n, vec_t &data, double mean) |
Absolute deviation from the specified mean. | |
template<class vec_t > | |
double | vector_absdev (size_t n, vec_t &data) |
Absolute deviation from the computed mean. | |
template<class vec_t > | |
double | vector_skew (size_t n, vec_t &data, double mean, double stddev) |
Skewness with specified mean and standard deviation. | |
template<class vec_t > | |
double | vector_skew (size_t n, vec_t &data) |
Skewness with computed mean and standard deviation. | |
template<class vec_t > | |
double | vector_kurtosis (size_t n, vec_t &data, double mean, double stddev) |
Kurtosis with specified mean and standard deviation. | |
template<class vec_t > | |
double | vector_kurtosis (size_t n, vec_t &data) |
Kurtosis with computed mean and standard deviation. | |
template<class vec_t > | |
double | vector_lag1_autocorr (size_t n, vec_t &data, double mean) |
Lag-1 autocorrelation. | |
template<class vec_t > | |
double | vector_lag1_autocorr (size_t n, vec_t &data) |
Lag-1 autocorrelation. | |
template<class vec_t > | |
double | vector_covariance (size_t n, vec_t &data1, vec_t &data2, double mean1, double mean2) |
Covariance. | |
template<class vec_t > | |
double | vector_covariance (size_t n, vec_t &data1, vec_t &data2) |
Covariance. | |
template<class vec_t > | |
double | vector_correlation (size_t n, vec_t &data1, vec_t &data2) |
Pearson's correlation. | |
template<class vec_t > | |
double | vector_pvariance (size_t n1, vec_t &data1, size_t n2, vec_t &data2) |
Pooled variance. | |
template<class vec_t > | |
double | vector_quantile_sorted (size_t n, vec_t &data, const double f) |
Quantile. | |
template<class vec_t > | |
double | vector_median_sorted (size_t n, vec_t &data) |
Median of sorted data. | |
template<class vec_t > | |
double | wvector_mean (size_t n, vec_t &data, vec_t &weights) |
Compute the mean of weighted data. | |
template<class vec_t > | |
double | wvector_factor (size_t n, vec_t &weights) |
Compute a factor for weighted data. | |
template<class vec_t , class vec2_t > | |
double | wvector_variance_fmean (size_t n, vec_t &data, vec_t &weights, double wmean) |
Compute the variance of a weighted vector with a mean known in advance. | |
template<class vec_t , class vec2_t > | |
double | wvector_variance (size_t n, vec_t &data, vec2_t &weights) |
Compute the variance of a weighted vector where mean is computed automatically. | |
template<class vec_t , class vec2_t > | |
double | wvector_variance (size_t n, vec_t &data, vec2_t &weights, double wmean) |
Compute the variance of a weighted vector with specified mean. | |
template<class vec_t , class vec2_t > | |
double | wvector_stddev_fmean (size_t n, vec_t &data, vec2_t &weights, double wmean) |
Compute the standard deviation of a weighted vector with a mean known in advance. | |
template<class vec_t , class vec2_t > | |
double | wvector_stddev (size_t n, vec_t &data, vec2_t &weights) |
Compute the standard deviation of a weighted vector where mean is computed automatically. | |
template<class vec_t , class vec2_t > | |
double | wvector_stddev (size_t n, vec_t &data, vec2_t &weights, double wmean) |
Compute the standard deviation of a weighted vector with specified mean. | |
template<class vec_t , class vec2_t > | |
double | wvector_sumsq_fmean (size_t n, vec_t &data, vec2_t &weights, double wmean) |
Desc. | |
template<class vec_t , class vec2_t > | |
double | wvector_sumsq (size_t n, vec_t &data, vec2_t &weights) |
Desc. | |
template<class vec_t , class vec2_t > | |
double | wvector_absdev (size_t n, vec_t &data, vec2_t &weights, double wmean) |
Desc. | |
template<class vec_t , class vec2_t > | |
double | wvector_skew (size_t n, vec_t &data, vec2_t &weights, double wmean, double wsd) |
Desc. | |
template<class vec_t , class vec2_t > | |
double | wvector_skew (size_t n, vec_t &data, vec2_t &weights) |
Desc. | |
template<class vec_t , class vec2_t > | |
double | wvector_kurtosis (size_t n, vec_t &data, vec2_t &weights, double wmean, double wsd) |
Desc. | |
template<class vec_t , class vec2_t > | |
double | wvector_kurtosis (size_t n, vec_t &data, vec2_t &weights) |
Desc. |
double vector_absdev | ( | size_t | n, | |
vec_t & | data | |||
) | [inline] |
This function computes
where the value of is given in
mean
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 229 of file vec_stats.h.
double vector_absdev | ( | size_t | n, | |
vec_t & | data, | |||
double | mean | |||
) | [inline] |
This function computes
where the value of is given in
mean
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 205 of file vec_stats.h.
double vector_correlation | ( | size_t | n, | |
vec_t & | data1, | |||
vec_t & | data2 | |||
) | [inline] |
If n
is zero, this function will call the error handler.
Definition at line 439 of file vec_stats.h.
double vector_covariance | ( | size_t | n, | |
vec_t & | data1, | |||
vec_t & | data2 | |||
) | [inline] |
This function computes
where and
are the averages of
data1
and data2
and are computed automatically.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 413 of file vec_stats.h.
double vector_covariance | ( | size_t | n, | |
vec_t & | data1, | |||
vec_t & | data2, | |||
double | mean1, | |||
double | mean2 | |||
) | [inline] |
This function computes
where and
are specified in
mean1
and mean2
, respectively.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 387 of file vec_stats.h.
double vector_kurtosis | ( | size_t | n, | |
vec_t & | data | |||
) | [inline] |
This function computes
where the values of and
are computed using vector_mean() and vector_stddev().
If n
is zero, this function will return zero without calling the error handler.
Definition at line 316 of file vec_stats.h.
double vector_kurtosis | ( | size_t | n, | |
vec_t & | data, | |||
double | mean, | |||
double | stddev | |||
) | [inline] |
This function computes
where the values of and
are given in
mean
and stddev
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 292 of file vec_stats.h.
double vector_lag1_autocorr | ( | size_t | n, | |
vec_t & | data | |||
) | [inline] |
This function computes
If n
is zero, this function will call the error handler.
Definition at line 368 of file vec_stats.h.
double vector_lag1_autocorr | ( | size_t | n, | |
vec_t & | data, | |||
double | mean | |||
) | [inline] |
This function computes
If n
is zero, this function will call the error handler.
Definition at line 336 of file vec_stats.h.
double vector_mean | ( | size_t | n, | |
vec_t & | data | |||
) | [inline] |
If n
is zero, this will return zero.
Definition at line 52 of file vec_stats.h.
double vector_median_sorted | ( | size_t | n, | |
vec_t & | data | |||
) | [inline] |
n
is zero, this function will return zero without calling the error handler.
Definition at line 524 of file vec_stats.h.
double vector_pvariance | ( | size_t | n1, | |
vec_t & | data1, | |||
size_t | n2, | |||
vec_t & | data2 | |||
) | [inline] |
n
is zero, this function will return zero without calling the error handler.
Definition at line 490 of file vec_stats.h.
double vector_quantile_sorted | ( | size_t | n, | |
vec_t & | data, | |||
const double | f | |||
) | [inline] |
n
is zero, this function will return zero without calling the error handler.
Definition at line 505 of file vec_stats.h.
double vector_skew | ( | size_t | n, | |
vec_t & | data | |||
) | [inline] |
This function computes
where the values of and
are computed using vector_mean() and vector_stddev().
If n
is zero, this function will return zero without calling the error handler.
Definition at line 272 of file vec_stats.h.
double vector_skew | ( | size_t | n, | |
vec_t & | data, | |||
double | mean, | |||
double | stddev | |||
) | [inline] |
This function computes
where the values of and
are given in
mean
and stddev
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 248 of file vec_stats.h.
double vector_stddev | ( | size_t | n, | |
vec_t & | data, | |||
double | mean | |||
) | [inline] |
This function computes
where the value of is given in
mean
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 181 of file vec_stats.h.
double vector_stddev | ( | size_t | n, | |
vec_t & | data | |||
) | [inline] |
This function computes
where is the mean computed with vector_mean().
If n
is 0 or 1, this function will call the error handler.
Definition at line 157 of file vec_stats.h.
double vector_stddev_fmean | ( | size_t | n, | |
vec_t & | data, | |||
double | mean | |||
) | [inline] |
This function computes
where the value of is given in
mean
.
If n
is zero, this function will return zero without calling the error handler.
Definition at line 139 of file vec_stats.h.
double vector_variance | ( | size_t | n, | |
vec_t & | data | |||
) | [inline] |
This function computes
where is the mean computed with vector_mean().
If n
is 0 or 1, this function will call the error handler.
Definition at line 115 of file vec_stats.h.
double vector_variance | ( | size_t | n, | |
vec_t & | data, | |||
double | mean | |||
) | [inline] |
This function computes
where the value of is given in
mean
.
If n
is 0 or 1, this function will call the error handler.
Definition at line 92 of file vec_stats.h.
double vector_variance_fmean | ( | size_t | n, | |
vec_t & | data, | |||
double | mean | |||
) | [inline] |
This function computes
where the value of is given in
mean
.
Definition at line 70 of file vec_stats.h.
double wvector_factor | ( | size_t | n, | |
vec_t & | weights | |||
) | [inline] |
This function is used in wvector_variance(size_t n, vec_t &data, vec2_t &weights, double wmean) and wvector_stddev(size_t n, vec_t &data, vec2_t &weights, double wmean) .
Definition at line 567 of file vec_stats.h.
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page