A high-performance general-purpose compute library
statistics.h File Reference
#include <af/defines.h>

Go to the source code of this file.

Namespaces

namespace  af
 

Functions

AFAPI array mean (const array &in, const dim_t dim=-1)
 C++ Interface for mean. More...
 
AFAPI array mean (const array &in, const array &weights, const dim_t dim=-1)
 C++ Interface for mean of weighted inputs. More...
 
AFAPI array var (const array &in, const bool isbiased=false, const dim_t dim=-1)
 C++ Interface for variance. More...
 
AFAPI array var (const array &in, const af_var_bias bias, const dim_t dim=-1)
 C++ Interface for variance. More...
 
AFAPI array var (const array &in, const array &weights, const dim_t dim=-1)
 C++ Interface for variance of weighted inputs. More...
 
AFAPI void meanvar (array &mean, array &var, const array &in, const array &weights, const af_var_bias bias=AF_VARIANCE_POPULATION, const dim_t dim=-1)
 C++ Interface for mean and variance. More...
 
AFAPI array stdev (const array &in, const dim_t dim=-1)
 C++ Interface for standard deviation. More...
 
AFAPI array stdev (const array &in, const af_var_bias bias, const dim_t dim=-1)
 C++ Interface for standard deviation. More...
 
AFAPI array cov (const array &X, const array &Y, const bool isbiased=false)
 C++ Interface for covariance. More...
 
AFAPI array cov (const array &X, const array &Y, const af_var_bias bias)
 C++ Interface for covariance. More...
 
AFAPI array median (const array &in, const dim_t dim=-1)
 C++ Interface for median. More...
 
template<typename T >
AFAPImean (const array &in)
 C++ Interface for mean of all elements. More...
 
template<typename T >
AFAPImean (const array &in, const array &weights)
 C++ Interface for mean of all elements in weighted input. More...
 
template<typename T >
AFAPIvar (const array &in, const bool isbiased=false)
 C++ Interface for variance of all elements. More...
 
template<typename T >
AFAPIvar (const array &in, const af_var_bias bias)
 C++ Interface for variance of all elements. More...
 
template<typename T >
AFAPIvar (const array &in, const array &weights)
 C++ Interface for variance of all elements in weighted input. More...
 
template<typename T >
AFAPIstdev (const array &in)
 C++ Interface for standard deviation of all elements. More...
 
template<typename T >
AFAPIstdev (const array &in, const af_var_bias bias)
 C++ Interface for standard deviation of all elements. More...
 
template<typename T >
AFAPImedian (const array &in)
 C++ Interface for median of all elements. More...
 
template<typename T >
AFAPIcorrcoef (const array &X, const array &Y)
 C++ Interface for correlation coefficient. More...
 
AFAPI void topk (array &values, array &indices, const array &in, const int k, const int dim=-1, const topkFunction order=AF_TOPK_MAX)
 C++ Interface for finding top k elements along a given dimension. More...
 
AFAPI af_err af_mean (af_array *out, const af_array in, const dim_t dim)
 C Interface for mean. More...
 
AFAPI af_err af_mean_weighted (af_array *out, const af_array in, const af_array weights, const dim_t dim)
 C Interface for mean of weighted input array. More...
 
AFAPI af_err af_var (af_array *out, const af_array in, const bool isbiased, const dim_t dim)
 C Interface for variance. More...
 
AFAPI af_err af_var_v2 (af_array *out, const af_array in, const af_var_bias bias, const dim_t dim)
 C Interface for variance. More...
 
AFAPI af_err af_var_weighted (af_array *out, const af_array in, const af_array weights, const dim_t dim)
 C Interface for variance of weighted input array. More...
 
AFAPI af_err af_meanvar (af_array *mean, af_array *var, const af_array in, const af_array weights, const af_var_bias bias, const dim_t dim)
 C Interface for mean and variance. More...
 
AFAPI af_err af_stdev (af_array *out, const af_array in, const dim_t dim)
 C Interface for standard deviation. More...
 
AFAPI af_err af_stdev_v2 (af_array *out, const af_array in, const af_var_bias bias, const dim_t dim)
 C Interface for standard deviation. More...
 
AFAPI af_err af_cov (af_array *out, const af_array X, const af_array Y, const bool isbiased)
 C Interface for covariance. More...
 
AFAPI af_err af_cov_v2 (af_array *out, const af_array X, const af_array Y, const af_var_bias bias)
 C Interface for covariance. More...
 
AFAPI af_err af_median (af_array *out, const af_array in, const dim_t dim)
 C Interface for median. More...
 
AFAPI af_err af_mean_all (double *real, double *imag, const af_array in)
 C Interface for mean of all elements. More...
 
AFAPI af_err af_mean_all_weighted (double *real, double *imag, const af_array in, const af_array weights)
 C Interface for mean of all elements in weighted input. More...
 
AFAPI af_err af_var_all (double *realVal, double *imagVal, const af_array in, const bool isbiased)
 C Interface for variance of all elements. More...
 
AFAPI af_err af_var_all_v2 (double *realVal, double *imagVal, const af_array in, const af_var_bias bias)
 C Interface for variance of all elements. More...
 
AFAPI af_err af_var_all_weighted (double *realVal, double *imagVal, const af_array in, const af_array weights)
 C Interface for variance of all elements in weighted input. More...
 
AFAPI af_err af_stdev_all (double *real, double *imag, const af_array in)
 C Interface for standard deviation of all elements. More...
 
AFAPI af_err af_stdev_all_v2 (double *real, double *imag, const af_array in, const af_var_bias bias)
 C Interface for standard deviation of all elements. More...
 
AFAPI af_err af_median_all (double *realVal, double *imagVal, const af_array in)
 C Interface for median. More...
 
AFAPI af_err af_corrcoef (double *realVal, double *imagVal, const af_array X, const af_array Y)
 C Interface for correlation coefficient. More...
 
AFAPI af_err af_topk (af_array *values, af_array *indices, const af_array in, const int k, const int dim, const af_topk_function order)
 C Interface for finding top k elements along a given dimension. More...
 

Function Documentation

◆ af_meanvar()

AFAPI af_err af_meanvar ( af_array mean,
af_array var,
const af_array  in,
const af_array  weights,
const af_var_bias  bias,
const dim_t  dim 
)

C Interface for mean and variance.

Parameters
[out]meanThe mean of the input array along dim dimension
[out]varThe variance of the input array along the dim dimension
[in]inThe input array
[in]weightsThe weights to scale the input array before calculating the mean and varience. If empty, the input is not scaled
[in]biasThe type of bias used for variance calculation
[in]dimThe dimension along which the variance and mean are calculated. Default is -1 meaning the first non-zero dim