Namespaces
vec_stats.h File Reference

Statistical functions for vector types. More...

#include <o2scl/err_hnd.h>
#include <o2scl/vector.h>

Go to the source code of this file.

Namespaces

 o2scl
 The main O2scl namespace.
 

Functions

Vector mean, std. dev., and variance in src/other/vec_stats.h
template<class vec_t >
double o2scl::vector_mean (size_t n, const vec_t &data)
 Compute the mean of the first n elements of a vector. More...
 
template<class vec_t >
double o2scl::vector_mean (const vec_t &data)
 Compute the mean of all of the vector elements. More...
 
template<class vec_t >
double o2scl::vector_variance_fmean (size_t n, const vec_t &data, double mean)
 Compute variance with specified mean known in advance. More...
 
template<class vec_t >
double o2scl::vector_variance_fmean (const vec_t &data, double mean)
 Compute variance with specified mean known in advance. More...
 
template<class vec_t >
double o2scl::vector_variance (size_t n, const vec_t &data, double mean)
 Compute the variance with specified mean. More...
 
template<class vec_t >
double o2scl::vector_variance (const vec_t &data, double mean)
 Compute the variance with specified mean. More...
 
template<class vec_t >
double o2scl::vector_variance (size_t n, const vec_t &data)
 Compute the variance. More...
 
template<class vec_t >
double o2scl::vector_variance (const vec_t &data)
 Compute the variance. More...
 
template<class vec_t >
double o2scl::vector_stddev_fmean (size_t n, const vec_t &data, double mean)
 Standard deviation with specified mean known in advance. More...
 
template<class vec_t >
double o2scl::vector_stddev_fmean (const vec_t &data, double mean)
 Standard deviation with specified mean known in advance. More...
 
template<class vec_t >
double o2scl::vector_stddev (size_t n, const vec_t &data)
 Standard deviation with specified mean. More...
 
template<class vec_t >
double o2scl::vector_stddev (const vec_t &data)
 Standard deviation with specified mean. More...
 
template<class vec_t >
double o2scl::vector_stddev (size_t n, const vec_t &data, double mean)
 Standard deviation with specified mean. More...
 
template<class vec_t >
double o2scl::vector_stddev (const vec_t &data, double mean)
 Standard deviation with specified mean. More...
 
template<class vec_t >
double o2scl::vector_absdev (size_t n, const vec_t &data, double mean)
 Absolute deviation from the specified mean. More...
 
Vector absolute deviation, skewness, etc. in src/other/vec_stats.h
template<class vec_t >
double o2scl::vector_absdev (const vec_t &data, double mean)
 Absolute deviation from the specified mean. More...
 
template<class vec_t >
double o2scl::vector_absdev (size_t n, const vec_t &data)
 Absolute deviation from the computed mean. More...
 
template<class vec_t >
double o2scl::vector_absdev (const vec_t &data)
 Absolute deviation from the computed mean. More...
 
template<class vec_t >
double o2scl::vector_skew (size_t n, const vec_t &data, double mean, double stddev)
 Skewness with specified mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_skew (const vec_t &data, double mean, double stddev)
 Skewness with specified mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_skew (size_t n, const vec_t &data)
 Skewness with computed mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_skew (const vec_t &data)
 Skewness with computed mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_kurtosis (size_t n, const vec_t &data, double mean, double stddev)
 Kurtosis with specified mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_kurtosis (const vec_t &data, double mean, double stddev)
 Kurtosis with specified mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_kurtosis (size_t n, const vec_t &data)
 Kurtosis with computed mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_kurtosis (const vec_t &data)
 Kurtosis with computed mean and standard deviation. More...
 
Other vector functions in src/other/vec_stats.h
template<class vec_t , class vec2_t >
double o2scl::vector_covariance (size_t n, const vec_t &data1, const vec2_t &data2, double mean1, double mean2)
 Compute the covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_covariance (const vec_t &data1, const vec2_t &data2, double mean1, double mean2)
 Compute the covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_covariance (size_t n, const vec_t &data1, const vec2_t &data2)
 Compute the covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_covariance (const vec_t &data1, const vec2_t &data2)
 Compute the covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_correlation (size_t n, const vec_t &data1, const vec2_t &data2)
 Pearson's correlation. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_correlation (const vec_t &data1, const vec2_t &data2)
 Pearson's correlation. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_pvariance (size_t n1, const vec_t &data1, size_t n2, const vec2_t &data2)
 The pooled variance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_pvariance (const vec_t &data1, const vec2_t &data2)
 The pooled variance of two vectors. More...
 
template<class vec_t >
double o2scl::vector_quantile_sorted (size_t n, const vec_t &data, const double f)
 Quantile from sorted data (ascending only) More...
 
template<class vec_t >
double o2scl::vector_quantile_sorted (const vec_t &data, const double f)
 Quantile from sorted data (ascending only) More...
 
template<class vec_t >
double o2scl::vector_median_sorted (size_t n, const vec_t &data)
 Return the median of sorted (ascending or descending) data. More...
 
template<class vec_t >
double o2scl::vector_median_sorted (const vec_t &data)
 Return the median of sorted (ascending or descending) data. More...
 
template<class vec_t , class vec2_t , class vec3_t >
double o2scl::vector_chi_squared (size_t n, const vec_t &obs, const vec2_t &exp, const vec3_t &err)
 Compute the chi-squared statistic. More...
 
template<class vec_t , class vec2_t , class vec3_t >
double o2scl::vector_chi_squared (const vec_t &obs, const vec2_t &exp, const vec3_t &err)
 Compute the chi-squared statistic. More...
 
template<class vec_t >
double o2scl::vector_bin_size_scott (size_t n, const vec_t &v)
 Optimal bin size using Scott's method for the first n elements.
 
template<class vec_t >
double o2scl::vector_bin_size_scott (const vec_t &v)
 Optimal bin size using Scott's method. More...
 
template<class vec_t >
double o2scl::vector_sorted_quantile (size_t n, const vec_t &v, double f)
 Obtain a quantile from a sorted vector. More...
 
template<class vec_t >
double o2scl::vector_bin_size_freedman (size_t n, vec_t &v)
 Optimal bin size using the Freedman-Diaconis rule for the first n elements

 
template<class vec_t >
double o2scl::vector_bin_size_freedman (vec_t &v)
 Optimal bin size using the Freedman-Diaconis rule. More...
 
Weighted vector mean, std. dev., etc. in src/other/vec_stats.h
template<class vec_t , class vec2_t >
double o2scl::wvector_mean (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the mean of weighted data. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_mean (const vec_t &data, const vec2_t &weights)
 Compute the mean of weighted data. More...
 
template<class vec_t >
double o2scl::wvector_factor (size_t n, const vec_t &weights)
 Compute a normalization factor for weighted data. More...
 
template<class vec_t >
double o2scl::wvector_factor (const vec_t &weights)
 Compute a normalization factor for weighted data. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance_fmean (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the variance of a weighted vector with a mean known in advance. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance_fmean (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the variance of a weighted vector with a mean known in advance. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the variance of a weighted vector with specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the variance of a weighted vector with specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the variance of a weighted vector where mean is computed automatically. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance (const vec_t &data, const vec2_t &weights)
 Compute the variance of a weighted vector where mean is computed automatically. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev_fmean (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the standard deviation of a weighted vector with a mean known in advance. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev_fmean (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the standard deviation of a weighted vector with a mean known in advance. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the standard deviation of a weighted vector where mean is computed automatically. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev (const vec_t &data, const vec2_t &weights)
 Compute the standard deviation of a weighted vector where mean is computed automatically. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the standard deviation of a weighted vector with specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the standard deviation of a weighted vector with specified mean. More...
 
Other weighted vector functions in src/other/vec_stats.h
template<class vec_t , class vec2_t , class vec3_t >
double o2scl::wvector_covariance (size_t n, const vec_t &data1, const vec2_t &data2, const vec3_t &weights)
 The weighted covariance of two vectors. More...
 
template<class vec_t , class vec2_t , class vec3_t >
double o2scl::wvector_covariance (const vec_t &data1, const vec2_t &data2, const vec3_t &weights)
 The weighted covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_sumsq (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the weighted sum of squares of data about the specified weighted mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_sumsq (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the weighted sum of squares of data about the specified weighted mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_sumsq (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the weighted sum of squares of data about the weighted mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_sumsq (const vec_t &data, const vec2_t &weights)
 Compute the weighted sum of squares of data about the weighted mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_absdev (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the absolute deviation of data about a specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_absdev (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the absolute deviation of data about a specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_absdev (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the absolute deviation of data about a specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_absdev (const vec_t &data, const vec2_t &weights)
 Compute the absolute deviation of data about a specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_skew (size_t n, const vec_t &data, const vec2_t &weights, double wmean, double wsd)
 Compute the skewness of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_skew (const vec_t &data, const vec2_t &weights, double wmean, double wsd)
 Compute the skewness of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_skew (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the skewness of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_skew (const vec_t &data, const vec2_t &weights)
 Compute the skewness of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_kurtosis (size_t n, const vec_t &data, const vec2_t &weights, double wmean, double wsd)
 Compute the kurtosis of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_kurtosis (const vec_t &data, const vec2_t &weights, double wmean, double wsd)
 Compute the kurtosis of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_kurtosis (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the kurtosis of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_kurtosis (const vec_t &data, const vec2_t &weights)
 Compute the kurtosis of data with specified mean and standard deviation. More...
 
Vector autocorrelation in src/other/vec_stats.h
template<class vec_t >
double o2scl::vector_lag1_autocorr (size_t n, const vec_t &data, double mean)
 Lag-1 autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lag1_autocorr (const vec_t &data, double mean)
 Lag-1 autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lag1_autocorr (size_t n, const vec_t &data)
 Lag-1 autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lag1_autocorr (const vec_t &data)
 Lag-1 autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lagk_autocorr (size_t n, const vec_t &data, size_t k, double mean)
 Lag-k autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lagk_autocorr (const vec_t &data, size_t k, double mean)
 Lag-k autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lagk_autocorr (size_t n, const vec_t &data, size_t k)
 Lag-k autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lagk_autocorr (const vec_t &data, size_t k)
 Lag-k autocorrelation. More...
 
template<class vec_t , class resize_vec_t >
void o2scl::vector_autocorr_vector (const vec_t &data, resize_vec_t &ac_vec)
 Construct an autocorrelation vector. More...
 
template<class vec_t , class resize_vec_t >
size_t o2scl::vector_autocorr_tau (const vec_t &ac_vec, resize_vec_t &five_tau_over_M)
 Use the Goodman method to compute the autocorrelation length. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_lagk_autocorr_mult (size_t n, const vec_t &data, const vec2_t &mult, size_t k, double mean)
 Lag-k autocorrelation for the first n elements with a vector multiplier given the mean.
 
template<class vec_t , class vec2_t >
double o2scl::vector_lagk_autocorr_mult (size_t n, const vec_t &data, const vec2_t &mult, size_t k)
 Lag-k autocorrelation for the first n elements with a vector multiplier.
 
template<class vec_t , class vec2_t >
double o2scl::vector_lagk_autocorr_mult (const vec_t &data, const vec2_t &mult, size_t k, double mean)
 Lag-k autocorrelation with a vector multiplier given the mean.
 
template<class vec_t , class vec2_t >
double o2scl::vector_lagk_autocorr_mult (const vec_t &data, const vec2_t &mult, size_t k)
 Lag-k autocorrelation with a vector multiplier.
 
template<class vec_t , class vec2_t , class resize_vec_t >
void o2scl::vector_autocorr_vector_mult (size_t n2, const vec_t &data, const vec2_t &mult, resize_vec_t &ac_vec)
 Construct an autocorrelation vector using a multiplier using the first n2 elements of vectors data and mult.
 
template<class vec_t , class vec2_t , class resize_vec_t >
void o2scl::vector_autocorr_vector_mult (const vec_t &data, const vec2_t &mult, resize_vec_t &ac_vec)
 Construct an autocorrelation vector using a multiplier.
 
Convert a vector to bin edges in src/other/vec_stats.h
template<class vec_t , class vec2_t >
void o2scl::vector_to_bins (const vec_t &v_grid, vec2_t &v_bins, int verbose=1)
 Take a vector of data and convert it to a vector of bin edges automatically adjusting for increasing or decreasing and linear or logarithmic spacing.
 
Vector mean, std. dev., and variance in src/other/vec_stats.h
template<class vec_t >
double o2scl::vector_mean (size_t n, const vec_t &data)
 Compute the mean of the first n elements of a vector. More...
 
template<class vec_t >
double o2scl::vector_mean (const vec_t &data)
 Compute the mean of all of the vector elements. More...
 
template<class vec_t >
double o2scl::vector_variance_fmean (size_t n, const vec_t &data, double mean)
 Compute variance with specified mean known in advance. More...
 
template<class vec_t >
double o2scl::vector_variance_fmean (const vec_t &data, double mean)
 Compute variance with specified mean known in advance. More...
 
template<class vec_t >
double o2scl::vector_variance (size_t n, const vec_t &data, double mean)
 Compute the variance with specified mean. More...
 
template<class vec_t >
double o2scl::vector_variance (const vec_t &data, double mean)
 Compute the variance with specified mean. More...
 
template<class vec_t >
double o2scl::vector_variance (size_t n, const vec_t &data)
 Compute the variance. More...
 
template<class vec_t >
double o2scl::vector_variance (const vec_t &data)
 Compute the variance. More...
 
template<class vec_t >
double o2scl::vector_stddev_fmean (size_t n, const vec_t &data, double mean)
 Standard deviation with specified mean known in advance. More...
 
template<class vec_t >
double o2scl::vector_stddev_fmean (const vec_t &data, double mean)
 Standard deviation with specified mean known in advance. More...
 
template<class vec_t >
double o2scl::vector_stddev (size_t n, const vec_t &data)
 Standard deviation with specified mean. More...
 
template<class vec_t >
double o2scl::vector_stddev (const vec_t &data)
 Standard deviation with specified mean. More...
 
template<class vec_t >
double o2scl::vector_stddev (size_t n, const vec_t &data, double mean)
 Standard deviation with specified mean. More...
 
template<class vec_t >
double o2scl::vector_stddev (const vec_t &data, double mean)
 Standard deviation with specified mean. More...
 
template<class vec_t >
double o2scl::vector_absdev (size_t n, const vec_t &data, double mean)
 Absolute deviation from the specified mean. More...
 
Vector absolute deviation, skewness, etc. in src/other/vec_stats.h
template<class vec_t >
double o2scl::vector_absdev (const vec_t &data, double mean)
 Absolute deviation from the specified mean. More...
 
template<class vec_t >
double o2scl::vector_absdev (size_t n, const vec_t &data)
 Absolute deviation from the computed mean. More...
 
template<class vec_t >
double o2scl::vector_absdev (const vec_t &data)
 Absolute deviation from the computed mean. More...
 
template<class vec_t >
double o2scl::vector_skew (size_t n, const vec_t &data, double mean, double stddev)
 Skewness with specified mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_skew (const vec_t &data, double mean, double stddev)
 Skewness with specified mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_skew (size_t n, const vec_t &data)
 Skewness with computed mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_skew (const vec_t &data)
 Skewness with computed mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_kurtosis (size_t n, const vec_t &data, double mean, double stddev)
 Kurtosis with specified mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_kurtosis (const vec_t &data, double mean, double stddev)
 Kurtosis with specified mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_kurtosis (size_t n, const vec_t &data)
 Kurtosis with computed mean and standard deviation. More...
 
template<class vec_t >
double o2scl::vector_kurtosis (const vec_t &data)
 Kurtosis with computed mean and standard deviation. More...
 
Other vector functions in src/other/vec_stats.h
template<class vec_t , class vec2_t >
double o2scl::vector_covariance (size_t n, const vec_t &data1, const vec2_t &data2, double mean1, double mean2)
 Compute the covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_covariance (const vec_t &data1, const vec2_t &data2, double mean1, double mean2)
 Compute the covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_covariance (size_t n, const vec_t &data1, const vec2_t &data2)
 Compute the covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_covariance (const vec_t &data1, const vec2_t &data2)
 Compute the covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_correlation (size_t n, const vec_t &data1, const vec2_t &data2)
 Pearson's correlation. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_correlation (const vec_t &data1, const vec2_t &data2)
 Pearson's correlation. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_pvariance (size_t n1, const vec_t &data1, size_t n2, const vec2_t &data2)
 The pooled variance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_pvariance (const vec_t &data1, const vec2_t &data2)
 The pooled variance of two vectors. More...
 
template<class vec_t >
double o2scl::vector_quantile_sorted (size_t n, const vec_t &data, const double f)
 Quantile from sorted data (ascending only) More...
 
template<class vec_t >
double o2scl::vector_quantile_sorted (const vec_t &data, const double f)
 Quantile from sorted data (ascending only) More...
 
template<class vec_t >
double o2scl::vector_median_sorted (size_t n, const vec_t &data)
 Return the median of sorted (ascending or descending) data. More...
 
template<class vec_t >
double o2scl::vector_median_sorted (const vec_t &data)
 Return the median of sorted (ascending or descending) data. More...
 
template<class vec_t , class vec2_t , class vec3_t >
double o2scl::vector_chi_squared (size_t n, const vec_t &obs, const vec2_t &exp, const vec3_t &err)
 Compute the chi-squared statistic. More...
 
template<class vec_t , class vec2_t , class vec3_t >
double o2scl::vector_chi_squared (const vec_t &obs, const vec2_t &exp, const vec3_t &err)
 Compute the chi-squared statistic. More...
 
template<class vec_t >
double o2scl::vector_bin_size_scott (size_t n, const vec_t &v)
 Optimal bin size using Scott's method for the first n elements.
 
template<class vec_t >
double o2scl::vector_bin_size_scott (const vec_t &v)
 Optimal bin size using Scott's method. More...
 
template<class vec_t >
double o2scl::vector_sorted_quantile (size_t n, const vec_t &v, double f)
 Obtain a quantile from a sorted vector. More...
 
template<class vec_t >
double o2scl::vector_bin_size_freedman (size_t n, vec_t &v)
 Optimal bin size using the Freedman-Diaconis rule for the first n elements

 
template<class vec_t >
double o2scl::vector_bin_size_freedman (vec_t &v)
 Optimal bin size using the Freedman-Diaconis rule. More...
 
Weighted vector mean, std. dev., etc. in src/other/vec_stats.h
template<class vec_t , class vec2_t >
double o2scl::wvector_mean (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the mean of weighted data. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_mean (const vec_t &data, const vec2_t &weights)
 Compute the mean of weighted data. More...
 
template<class vec_t >
double o2scl::wvector_factor (size_t n, const vec_t &weights)
 Compute a normalization factor for weighted data. More...
 
template<class vec_t >
double o2scl::wvector_factor (const vec_t &weights)
 Compute a normalization factor for weighted data. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance_fmean (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the variance of a weighted vector with a mean known in advance. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance_fmean (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the variance of a weighted vector with a mean known in advance. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the variance of a weighted vector with specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the variance of a weighted vector with specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the variance of a weighted vector where mean is computed automatically. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_variance (const vec_t &data, const vec2_t &weights)
 Compute the variance of a weighted vector where mean is computed automatically. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev_fmean (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the standard deviation of a weighted vector with a mean known in advance. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev_fmean (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the standard deviation of a weighted vector with a mean known in advance. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the standard deviation of a weighted vector where mean is computed automatically. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev (const vec_t &data, const vec2_t &weights)
 Compute the standard deviation of a weighted vector where mean is computed automatically. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the standard deviation of a weighted vector with specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_stddev (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the standard deviation of a weighted vector with specified mean. More...
 
Other weighted vector functions in src/other/vec_stats.h
template<class vec_t , class vec2_t , class vec3_t >
double o2scl::wvector_covariance (size_t n, const vec_t &data1, const vec2_t &data2, const vec3_t &weights)
 The weighted covariance of two vectors. More...
 
template<class vec_t , class vec2_t , class vec3_t >
double o2scl::wvector_covariance (const vec_t &data1, const vec2_t &data2, const vec3_t &weights)
 The weighted covariance of two vectors. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_sumsq (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the weighted sum of squares of data about the specified weighted mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_sumsq (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the weighted sum of squares of data about the specified weighted mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_sumsq (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the weighted sum of squares of data about the weighted mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_sumsq (const vec_t &data, const vec2_t &weights)
 Compute the weighted sum of squares of data about the weighted mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_absdev (size_t n, const vec_t &data, const vec2_t &weights, double wmean)
 Compute the absolute deviation of data about a specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_absdev (const vec_t &data, const vec2_t &weights, double wmean)
 Compute the absolute deviation of data about a specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_absdev (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the absolute deviation of data about a specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_absdev (const vec_t &data, const vec2_t &weights)
 Compute the absolute deviation of data about a specified mean. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_skew (size_t n, const vec_t &data, const vec2_t &weights, double wmean, double wsd)
 Compute the skewness of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_skew (const vec_t &data, const vec2_t &weights, double wmean, double wsd)
 Compute the skewness of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_skew (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the skewness of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_skew (const vec_t &data, const vec2_t &weights)
 Compute the skewness of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_kurtosis (size_t n, const vec_t &data, const vec2_t &weights, double wmean, double wsd)
 Compute the kurtosis of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_kurtosis (const vec_t &data, const vec2_t &weights, double wmean, double wsd)
 Compute the kurtosis of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_kurtosis (size_t n, const vec_t &data, const vec2_t &weights)
 Compute the kurtosis of data with specified mean and standard deviation. More...
 
template<class vec_t , class vec2_t >
double o2scl::wvector_kurtosis (const vec_t &data, const vec2_t &weights)
 Compute the kurtosis of data with specified mean and standard deviation. More...
 
Vector autocorrelation in src/other/vec_stats.h
template<class vec_t >
double o2scl::vector_lag1_autocorr (size_t n, const vec_t &data, double mean)
 Lag-1 autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lag1_autocorr (const vec_t &data, double mean)
 Lag-1 autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lag1_autocorr (size_t n, const vec_t &data)
 Lag-1 autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lag1_autocorr (const vec_t &data)
 Lag-1 autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lagk_autocorr (size_t n, const vec_t &data, size_t k, double mean)
 Lag-k autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lagk_autocorr (const vec_t &data, size_t k, double mean)
 Lag-k autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lagk_autocorr (size_t n, const vec_t &data, size_t k)
 Lag-k autocorrelation. More...
 
template<class vec_t >
double o2scl::vector_lagk_autocorr (const vec_t &data, size_t k)
 Lag-k autocorrelation. More...
 
template<class vec_t , class resize_vec_t >
void o2scl::vector_autocorr_vector (const vec_t &data, resize_vec_t &ac_vec)
 Construct an autocorrelation vector. More...
 
template<class vec_t , class resize_vec_t >
size_t o2scl::vector_autocorr_tau (const vec_t &ac_vec, resize_vec_t &five_tau_over_M)
 Use the Goodman method to compute the autocorrelation length. More...
 
template<class vec_t , class vec2_t >
double o2scl::vector_lagk_autocorr_mult (size_t n, const vec_t &data, const vec2_t &mult, size_t k, double mean)
 Lag-k autocorrelation for the first n elements with a vector multiplier given the mean.
 
template<class vec_t , class vec2_t >
double o2scl::vector_lagk_autocorr_mult (size_t n, const vec_t &data, const vec2_t &mult, size_t k)
 Lag-k autocorrelation for the first n elements with a vector multiplier.
 
template<class vec_t , class vec2_t >
double o2scl::vector_lagk_autocorr_mult (const vec_t &data, const vec2_t &mult, size_t k, double mean)
 Lag-k autocorrelation with a vector multiplier given the mean.
 
template<class vec_t , class vec2_t >
double o2scl::vector_lagk_autocorr_mult (const vec_t &data, const vec2_t &mult, size_t k)
 Lag-k autocorrelation with a vector multiplier.
 
template<class vec_t , class vec2_t , class resize_vec_t >
void o2scl::vector_autocorr_vector_mult (size_t n2, const vec_t &data, const vec2_t &mult, resize_vec_t &ac_vec)
 Construct an autocorrelation vector using a multiplier using the first n2 elements of vectors data and mult.
 
template<class vec_t , class vec2_t , class resize_vec_t >
void o2scl::vector_autocorr_vector_mult (const vec_t &data, const vec2_t &mult, resize_vec_t &ac_vec)
 Construct an autocorrelation vector using a multiplier.
 
Convert a vector to bin edges in src/other/vec_stats.h
template<class vec_t , class vec2_t >
void o2scl::vector_to_bins (const vec_t &v_grid, vec2_t &v_bins, int verbose=1)
 Take a vector of data and convert it to a vector of bin edges automatically adjusting for increasing or decreasing and linear or logarithmic spacing.
 

Detailed Description

This file contains several function templates for computing statistics of vectors of double-precision data. It includes mean, median, variance, standard deviation, covariance, correlation, and other functions.

No additional range checking is done on the vectors.

Idea for Future:
Consider generalizing to other data types.

Definition in file vec_stats.h.

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).