Miscellaneous Statistics Functions
Statistics Module

## Classes

class | itpp::Stat
| A class for sampling a signal and calculating statistics. More...

## Functions

double | itpp::mean (const vec &v)
| The mean value.
std::complex< double > | itpp::mean (const cvec &v)
| The mean value.
double | itpp::mean (const svec &v)
| The mean value.
double | itpp::mean (const ivec &v)
| The mean value.
double | itpp::mean (const mat &m)
| The mean value.
std::complex< double > | itpp::mean (const cmat &m)
| The mean value.
double | itpp::mean (const smat &m)
| The mean value.
double | itpp::mean (const imat &m)
| The mean value.
template<class T >
double | itpp::geometric_mean (const Vec< T > &v)
| The geometric mean of a vector.
template<class T >
double | itpp::geometric_mean (const Mat< T > &m)
| The geometric mean of a matrix.
template<class T >
double | itpp::median (const Vec< T > &v)
| The median.
double | itpp::norm (const cvec &v)
| Calculate the 2-norm: norm(v)=sqrt(sum(abs(v).^2))
template<class T >
double | itpp::norm (const Vec< T > &v)
| Calculate the 2-norm: norm(v)=sqrt(sum(abs(v).^2))
double | itpp::norm (const cvec &v, int p)
| Calculate the p-norm: norm(v,p)=sum(abs(v).^2)^(1/p)
template<class T >
double | itpp::norm (const Vec< T > &v, int p)
| Calculate the p-norm: norm(v,p)=sum(abs(v).^2)^(1/p)
double | itpp::norm (const cvec &v, const std::string &s)
| Calculate the Frobenius norm for s = "fro" (equal to 2-norm)
template<class T >
double | itpp::norm (const Vec< T > &v, const std::string &s)
| Calculate the Frobenius norm for s = "fro" (equal to 2-norm)
double | itpp::norm (const mat &m, int p)
double | itpp::norm (const cmat &m, int p)
double | itpp::norm (const mat &m, const std::string &s)
| Calculate the Frobenius norm of a matrix for s = "fro".
double | itpp::norm (const cmat &m, const std::string &s)
| Calculate the Frobenius norm of a matrix for s = "fro".
double | itpp::variance (const cvec &v)
| The variance of the elements in the vector. Normalized with N-1 to be unbiased.
template<class T >
double | itpp::variance (const Vec< T > &v)
| The variance of the elements in the vector. Normalized with N-1 to be unbiased.
template<class T >
double | itpp::energy (const Vec< T > &v)
| Calculate the energy: squared 2-norm. energy(v)=sum(abs(v).^2)
bool | itpp::within_tolerance (double x, double xref, double tol=1e-14)
| Return true if the input value `x` is within the tolerance `tol` of the reference value `xref`.
bool | itpp::within_tolerance (std::complex< double > x, std::complex< double > xref, double tol=1e-14)
| Return true if the input value `x` is within the tolerance `tol` of the reference value `xref`.
bool | itpp::within_tolerance (const vec &x, const vec &xref, double tol=1e-14)
| Return true if the input vector `x` is elementwise within the tolerance `tol` of the reference vector `xref`.
bool | itpp::within_tolerance (const cvec &x, const cvec &xref, double tol=1e-14)
| Return true if the input vector `x` is elementwise within the tolerance `tol` of the reference vector `xref`.
bool | itpp::within_tolerance (const mat &X, const mat &Xref, double tol=1e-14)
| Return true if the input matrix `X` is elementwise within the tolerance `tol` of the reference matrix `Xref`.
bool | itpp::within_tolerance (const cmat &X, const cmat &Xref, double tol=1e-14)
| Return true if the input matrix `X` is elementwise within the tolerance `tol` of the reference matrix `Xref`.
double | itpp::moment (const vec &x, const int r)
| Calculate the central moment of vector x.
double | itpp::skewness (const vec &x)
| Calculate the skewness excess of the input vector x.
double | itpp::kurtosisexcess (const vec &x)
| Calculate the kurtosis excess of the input vector x.
double | itpp::kurtosis (const vec &x)
| Calculate the kurtosis of the input vector x.

## Detailed Description

## Function Documentation

## mean() [1/8]

ITPP_EXPORT double itpp::mean | ( | const vec & | v | ) |

The mean value.

Definition at line 36 of file misc_stat.cpp.

References itpp::Array< T >::length(), and itpp::sum().

Referenced by itpp::Complex_Normal_RNG::Complex_Normal_RNG(), itpp::cov(), itpp::Complex_Normal_RNG::get_setup(), itpp::MOG_generic::log_lhood_single_gaus_internal(), itpp::moment(), itpp::Normal_RNG::operator()(), itpp::Normal_RNG::operator()(), itpp::Normal_RNG::operator()(), remmean(), itpp::Laplace_RNG::sample(), itpp::Sawtooth_Source::Sawtooth_Source(), itpp::Normal_RNG::setup(), itpp::Complex_Normal_RNG::setup(), itpp::Sine_Source::Sine_Source(), itpp::Square_Source::Square_Source(), and itpp::Triangle_Source::Triangle_Source().

## mean() [2/8]

ITPP_EXPORT std::complex< double > itpp::mean | ( | const cvec & | v | ) |

The mean value.

Definition at line 41 of file misc_stat.cpp.

References itpp::Array< T >::size(), and itpp::sum().

## mean() [3/8]

ITPP_EXPORT double itpp::mean | ( | const svec & | v | ) |

The mean value.

Definition at line 46 of file misc_stat.cpp.

References itpp::Array< T >::length(), and itpp::sum().

## mean() [4/8]

ITPP_EXPORT double itpp::mean | ( | const ivec & | v | ) |

The mean value.

Definition at line 51 of file misc_stat.cpp.

References itpp::Array< T >::length(), and itpp::sum().

## mean() [5/8]

ITPP_EXPORT double itpp::mean | ( | const mat & | m | ) |

The mean value.

Definition at line 56 of file misc_stat.cpp.

References itpp::sum().

## mean() [6/8]

ITPP_EXPORT std::complex< double > itpp::mean | ( | const cmat & | m | ) |

The mean value.

Definition at line 61 of file misc_stat.cpp.

References itpp::sum().

## mean() [7/8]

ITPP_EXPORT double itpp::mean | ( | const smat & | m | ) |

The mean value.

Definition at line 66 of file misc_stat.cpp.

References itpp::sum().

## mean() [8/8]

ITPP_EXPORT double itpp::mean | ( | const imat & | m | ) |

The mean value.

Definition at line 71 of file misc_stat.cpp.

References itpp::sum().

## geometric_mean() [1/2]

template<class T >

double itpp::geometric_mean | ( | const Vec< T > & | v | ) |

The geometric mean of a vector.

Definition at line 139 of file misc_stat.h.

References itpp::Array< T >::length(), and itpp::prod().

## geometric_mean() [2/2]

template<class T >

double itpp::geometric_mean | ( | const Mat< T > & | m | ) |

The geometric mean of a matrix.

Definition at line 146 of file misc_stat.h.

References itpp::prod().

## median()

template<class T >

double itpp::median | ( | const Vec< T > & | v | ) |

The median.

Definition at line 154 of file misc_stat.h.

References itpp::Array< T >::length().

## norm() [1/10]

ITPP_EXPORT double itpp::norm | ( | const cvec & | v | ) |

Calculate the 2-norm: norm(v)=sqrt(sum(abs(v).^2))

Definition at line 77 of file misc_stat.cpp.

References itpp::Array< T >::length().

Referenced by itpp::energy(), fpica(), itpp::IFFT_Fading_Generator::generate_Jakes(), itpp::FIR_Fading_Generator::Jakes_filter(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), mpower(), itpp::norm(), itpp::Newton_Search::search(), itpp::Line_Search::search(), itpp::TDL_Channel::set_channel_profile(), itpp::TDL_Channel::set_channel_profile(), itpp::Spread_1d::set_code(), and itpp::Multicode_Spread_1d::set_codes().

## norm() [2/10]

template<class T >

double itpp::norm | ( | const Vec< T > & | v | ) |

Calculate the 2-norm: norm(v)=sqrt(sum(abs(v).^2))

Definition at line 166 of file misc_stat.h.

References itpp::Array< T >::size(), and itpp::sqr().

## norm() [3/10]

ITPP_EXPORT double itpp::norm | ( | const cvec & | v,
|  | int | p
| ) |  |

Calculate the p-norm: norm(v,p)=sum(abs(v).^2)^(1/p)

Definition at line 86 of file misc_stat.cpp.

References itpp::Array< T >::size().

## norm() [4/10]

template<class T >

double itpp::norm | ( | const Vec< T > & | v,
|  | int | p
| ) |  |

Calculate the p-norm: norm(v,p)=sum(abs(v).^2)^(1/p)

Definition at line 180 of file misc_stat.h.

References itpp::Array< T >::size().

## norm() [5/10]

ITPP_EXPORT double itpp::norm | ( | const cvec & | v,
|  | const std::string & |
| ) |  |

Calculate the Frobenius norm for s = "fro" (equal to 2-norm)

Definition at line 95 of file misc_stat.cpp.

References itpp::norm().

## norm() [6/10]

template<class T >

double itpp::norm | ( | const Vec< T > & | v,
|  | const std::string & | s
| ) |  |

Calculate the Frobenius norm for s = "fro" (equal to 2-norm)

Definition at line 194 of file misc_stat.h.

References it_assert, itpp::Array< T >::size(), and itpp::sqr().

## norm() [7/10]

ITPP_EXPORT double itpp::norm | ( | const mat & | m,
|  | int | p = `2`
| ) |  |

Calculate the p-norm of a real matrix

p = 1: max(svd(m)) p = 2: max(sum(abs(X)))

Default if no p is given is the 2-norm

Definition at line 105 of file misc_stat.cpp.

References itpp::abs(), it_assert, itpp::max(), itpp::sum(), and itpp::svd().

## norm() [8/10]

ITPP_EXPORT double itpp::norm | ( | const cmat & | m,
|  | int | p = `2`
| ) |  |

Calculate the p-norm of a complex matrix

p = 1: max(svd(m)) p = 2: max(sum(abs(X)))

Default if no p is given is the 2-norm

Definition at line 121 of file misc_stat.cpp.

References itpp::abs(), it_assert, itpp::max(), itpp::sum(), and itpp::svd().

## norm() [9/10]

ITPP_EXPORT double itpp::norm | ( | const mat & | m,
|  | const std::string & | s
| ) |  |

Calculate the Frobenius norm of a matrix for s = "fro".

Definition at line 133 of file misc_stat.cpp.

References it_assert.

## norm() [10/10]

ITPP_EXPORT double itpp::norm | ( | const cmat & | m,
|  | const std::string & | s
| ) |  |

Calculate the Frobenius norm of a matrix for s = "fro".

Definition at line 146 of file misc_stat.cpp.

References it_assert.

## variance() [1/2]

ITPP_EXPORT double itpp::variance | ( | const cvec & | v | ) |

The variance of the elements in the vector. Normalized with N-1 to be unbiased.

Definition at line 159 of file misc_stat.cpp.

References itpp::Array< T >::size(), and itpp::sum().

Referenced by itpp::AR1_Normal_RNG::AR1_Normal_RNG(), itpp::Complex_Normal_RNG::Complex_Normal_RNG(), itpp::Normal_RNG::get_setup(), itpp::Laplace_RNG::get_setup(), itpp::AR1_Normal_RNG::get_setup(), itpp::Complex_Normal_RNG::get_setup(), itpp::kurtosisexcess(), itpp::Laplace_RNG::Laplace_RNG(), itpp::Normal_RNG::setup(), itpp::Laplace_RNG::setup(), itpp::AR1_Normal_RNG::setup(), itpp::Complex_Normal_RNG::setup(), and itpp::skewness().

## variance() [2/2]

template<class T >

double itpp::variance | ( | const Vec< T > & | v | ) |

The variance of the elements in the vector. Normalized with N-1 to be unbiased.

Definition at line 237 of file misc_stat.h.

References itpp::Array< T >::size(), and itpp::sum().

## energy()

template<class T >

double itpp::energy | ( | const Vec< T > & | v | ) |

Calculate the energy: squared 2-norm. energy(v)=sum(abs(v).^2)

Definition at line 253 of file misc_stat.h.

References itpp::norm(), and itpp::sqr().

Referenced by itpp::spectrum(), and itpp::xcorr_old().

## within_tolerance() [1/6]

bool itpp::within_tolerance | ( | double | x,
|  | double | xref,
|  | double | tol = `1e-14`
| ) |  |

inline

Return true if the input value `x` is within the tolerance `tol` of the reference value `xref`.

Definition at line 260 of file misc_stat.h.

## within_tolerance() [2/6]

bool itpp::within_tolerance | ( | std::complex< double > | x,
|  | std::complex< double > | xref,
|  | double | tol = `1e-14`
| ) |  |

inline

Return true if the input value `x` is within the tolerance `tol` of the reference value `xref`.

Definition at line 266 of file misc_stat.h.

References itpp::abs().

## within_tolerance() [3/6]

bool itpp::within_tolerance | ( | const vec & | x,
|  | const vec & | xref,
|  | double | tol = `1e-14`
| ) |  |

inline

Return true if the input vector `x` is elementwise within the tolerance `tol` of the reference vector `xref`.

Definition at line 272 of file misc_stat.h.

References itpp::abs(), and itpp::max().

## within_tolerance() [4/6]

bool itpp::within_tolerance | ( | const cvec & | x,
|  | const cvec & | xref,
|  | double | tol = `1e-14`
| ) |  |

inline

Return true if the input vector `x` is elementwise within the tolerance `tol` of the reference vector `xref`.

Definition at line 278 of file misc_stat.h.

References itpp::abs(), and itpp::max().

## within_tolerance() [5/6]

bool itpp::within_tolerance | ( | const mat & | X,
|  | const mat & | Xref,
|  | double | tol = `1e-14`
| ) |  |

inline

Return true if the input matrix `X` is elementwise within the tolerance `tol` of the reference matrix `Xref`.

Definition at line 284 of file misc_stat.h.

References itpp::abs(), and itpp::max().

## within_tolerance() [6/6]

bool itpp::within_tolerance | ( | const cmat & | X,
|  | const cmat & | Xref,
|  | double | tol = `1e-14`
| ) |  |

inline

Return true if the input matrix `X` is elementwise within the tolerance `tol` of the reference matrix `Xref`.

Definition at line 290 of file misc_stat.h.

References itpp::abs(), and itpp::max().

## moment()

ITPP_EXPORT double itpp::moment | ( | const vec & | x,
|  | const int | r
| ) |  |

Calculate the central moment of vector x.

The th sample central moment of the samples in the vector is defined as

where is the sample mean.

Definition at line 174 of file misc_stat.cpp.

References itpp::mean(), and itpp::Array< T >::size().

Referenced by itpp::kurtosisexcess(), and itpp::skewness().

## skewness()

ITPP_EXPORT double itpp::skewness | ( | const vec & | x | ) |

Calculate the skewness excess of the input vector x.

The skewness is a measure of the degree of asymmetry of distribution. Negative skewness means that the distribution is spread more to the left of the mean than to the right, and vice versa if the skewness is positive.

The skewness of the samples in the vector is

where is the mean and the standard deviation.

The skewness is estimated as

where

and

Here is the sample variance and is the 3rd sample central moment.

Definition at line 210 of file misc_stat.cpp.

References itpp::moment(), itpp::Array< T >::size(), and itpp::variance().

## kurtosisexcess()

ITPP_EXPORT double itpp::kurtosisexcess | ( | const vec & | x | ) |

Calculate the kurtosis excess of the input vector x.

The kurtosis excess is a measure of peakedness of a distribution. The kurtosis excess is defined as

where is the mean and the standard deviation.

The kurtosis excess is estimated as

where

and

Here is the sample variance and is the 4th sample central moment.

Definition at line 220 of file misc_stat.cpp.

References itpp::moment(), itpp::Array< T >::size(), and itpp::variance().

Referenced by itpp::kurtosis().

## kurtosis()

double itpp::kurtosis | ( | const vec & | x | ) |

inline

Calculate the kurtosis of the input vector x.

The kurtosis is a measure of peakedness of a distribution. The kurtosis is defined as

where is the mean and the standard deviation. For a Gaussian variable, the kurtusis is 3.

See also the definition of kurtosisexcess.

Definition at line 379 of file misc_stat.h.

References itpp::kurtosisexcess().

Generated on Mon Jun 10 2024 11:49:31 for IT++ by Doxygen 1.9.8