IT++ Logo Newcom Logo

Statistics


Classes

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

Functions

template<class T>
itpp::max (const Vec< T > &v)
 Maximum value of vector.
template<class T>
itpp::max (const Vec< T > &v, int &index)
 Maximum value of vector, also returns the index position of max value.
template<class T>
Vec< T > itpp::max (const Mat< T > &m, int dim=1)
template<class T>
Vec< T > itpp::max (const Mat< T > &m, ivec &index, int dim=1)
template<class T>
itpp::min (const Vec< T > &in)
 Minimum value of vector.
template<class T>
itpp::min (const Vec< T > &in, int &index)
 Minimum value of vector, also returns the index position of min value.
template<class T>
Vec< T > itpp::min (const Mat< T > &m, int dim=1)
template<class T>
Vec< T > itpp::min (const Mat< T > &m, ivec &index, int dim=1)
template<class T>
int itpp::max_index (const Vec< T > &in)
 Return the postion of the maximum element in the vector.
template<class T>
void itpp::max_index (const Mat< T > &m, int &row, int &col)
 Return the postion of the maximum element in the matrix.
template<class T>
int itpp::min_index (const Vec< T > &in)
 Return the postion of the minimum element in the vector.
template<class T>
void itpp::min_index (const Mat< T > &m, int &row, int &col)
 Return the postion of the minimum element in the matrix.
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)
template<class T>
double itpp::geometric_mean (const Vec< T > &v)
 The geometric mean value.
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 frobeniuos norm for s = "fro" (equal to 2-norm).
template<class T>
double itpp::norm (const Vec< T > &v, const std::string &s)
 Calculate the frobeniuos 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 frobeniuos norm of a matrix for s = "fro".
double itpp::norm (const cmat &m, const std::string &s)
 Calculate the frobeniuos 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.

Function Documentation

template<class T>
T itpp::max const Vec< T > &  v  ) 
 

Maximum value of vector.

Definition at line 127 of file stat.h.

References itpp::Vec< Num_T >::length().

Referenced by itpp::Sparse_Vec< T >::add(), itpp::TCP_Segment::combine(), itpp::TDL_Channel::filter_known_channel(), itpp::GF2mat::GF2mat(), itpp::max(), itpp::norm(), itpp::Newton_Search::search(), itpp::Modulator_2d::set(), itpp::Sparse_Vec< T >::set(), and itpp::Sparse_Vec< T >::set_new().

template<class T>
T itpp::max const Vec< T > &  v,
int &  index
 

Maximum value of vector, also returns the index position of max value.

Definition at line 138 of file stat.h.

References itpp::Vec< Num_T >::length().

template<class T>
Vec<T> itpp::max const Mat< T > &  m,
int  dim = 1
 

Maximum values over each row/column in the matrix m

max(m) = max(m, 1) returns a vector where the elements are maximum over each column, whereas max(m, 2) returns a vector where the elements are maximum over each row.

Definition at line 158 of file stat.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), it_assert, itpp::max(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

template<class T>
Vec<T> itpp::max const Mat< T > &  m,
ivec index,
int  dim = 1
 

Maximum values over each row/column in the matrix m

max(m) = max(m, 1) returns a vector where the elements are maximum over each column, whereas max(m, 2) returns a vector where the elements are maximum over each row.

Also returns a vector of indices with positions of maximum value within a column/row.

Definition at line 189 of file stat.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), it_assert, itpp::max(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

template<class T>
T itpp::min const Vec< T > &  in  ) 
 

Minimum value of vector.

Definition at line 213 of file stat.h.

References itpp::Vec< Num_T >::length().

Referenced by itpp::TCP_Segment::combine(), itpp::GF2mat::GF2mat(), itpp::min(), itpp::Modulator_2d::set(), itpp::TDL_Channel::set_channel_profile(), itpp::Channel_Specification::set_channel_profile(), itpp::ACK_Channel::set_errors(), itpp::Packet_Channel::set_errors(), itpp::Stack< T >::set_size(), and itpp::Array< T >::set_size().

template<class T>
T itpp::min const Vec< T > &  in,
int &  index
 

Minimum value of vector, also returns the index position of min value.

Definition at line 224 of file stat.h.

References itpp::Vec< Num_T >::length().

template<class T>
Vec<T> itpp::min const Mat< T > &  m,
int  dim = 1
 

Minimum values over each row/column in the matrix m

min(m) = min(m, 1) returns a vector where the elements are minimum over each column, whereas min(m, 2) returns a vector where the elements are minimum over each row.

Definition at line 245 of file stat.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), it_assert, itpp::min(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

template<class T>
Vec<T> itpp::min const Mat< T > &  m,
ivec index,
int  dim = 1
 

Minimum values over each row/column in the matrix m

min(m) = min(m, 1) returns a vector where the elements are minimum over each column, whereas min(m, 2) returns a vector where the elements are minimum over each row.

Also returns a vector of indices with positions of minimum value within a column/row.

Definition at line 276 of file stat.h.

References itpp::Mat< Num_T >::cols(), itpp::Mat< Num_T >::get_col(), itpp::Mat< Num_T >::get_row(), it_assert, itpp::min(), itpp::Mat< Num_T >::rows(), and itpp::Vec< Num_T >::set_size().

template<class T>
int itpp::max_index const Vec< T > &  in  ) 
 

Return the postion of the maximum element in the vector.

Definition at line 300 of file stat.h.

References itpp::Vec< Num_T >::length().

Referenced by itpp::bitalloc(), and itpp::Fast_ICA::separate().

template<class T>
void itpp::max_index const Mat< T > &  m,
int &  row,
int &  col
 

Return the postion of the maximum element in the matrix.

Definition at line 311 of file stat.h.

References itpp::Mat< Num_T >::cols(), and itpp::Mat< Num_T >::rows().

template<class T>
int itpp::min_index const Vec< T > &  in  ) 
 

Return the postion of the minimum element in the vector.

Definition at line 328 of file stat.h.

References itpp::Vec< Num_T >::length().

template<class T>
void itpp::min_index const Mat< T > &  m,
int &  row,
int &  col
 

Return the postion of the minimum element in the matrix.

Definition at line 339 of file stat.h.

References itpp::Mat< Num_T >::cols(), and itpp::Mat< Num_T >::rows().

double itpp::mean const vec v  ) 
 

The mean value.

Definition at line 39 of file stat.cpp.

References itpp::sum().

Referenced by itpp::cov(), itpp::gmmtrain(), itpp::moment(), itpp::Normal_RNG::Normal_RNG(), itpp::Normal_RNG::operator()(), remmean(), itpp::Laplace_RNG::sample(), and itpp::Normal_RNG::setup().

std::complex< double > itpp::mean const cvec v  ) 
 

The mean value.

Definition at line 44 of file stat.cpp.

References itpp::sum().

double itpp::mean const svec v  ) 
 

The mean value.

Definition at line 49 of file stat.cpp.

References itpp::sum().

double itpp::mean const ivec v  ) 
 

The mean value.

Definition at line 54 of file stat.cpp.

References itpp::sum().

double itpp::mean const mat m  ) 
 

The mean value.

Definition at line 59 of file stat.cpp.

References itpp::sum().

std::complex< double > itpp::mean const cmat m  ) 
 

The mean value.

Definition at line 64 of file stat.cpp.

References itpp::sum().

double itpp::mean const smat m  ) 
 

The mean value.

Definition at line 69 of file stat.cpp.

References itpp::sum().

template<class T>
double itpp::geometric_mean const Vec< T > &  v  ) 
 

The geometric mean value.

Definition at line 373 of file stat.h.

References itpp::exp(), and itpp::log().

template<class T>
double itpp::median const Vec< T > &  v  ) 
 

The median.

Definition at line 381 of file stat.h.

References itpp::Vec< Num_T >::length().

double itpp::norm const cvec v  ) 
 

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

Definition at line 80 of file stat.cpp.

References itpp::sqrt().

Referenced by itpp::energy(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), mpower(), itpp::norm(), itpp::Line_Search::search(), itpp::Newton_Search::search(), itpp::Spread_1d::set_code(), itpp::Multicode_Spread_1d::set_codes(), and itpp::variance().

template<class T>
double itpp::norm const Vec< T > &  v  ) 
 

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

Definition at line 393 of file stat.h.

References itpp::Vec< Num_T >::size(), itpp::sqr(), and itpp::sqrt().

double itpp::norm const cvec v,
int  p
 

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

Definition at line 89 of file stat.cpp.

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

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 407 of file stat.h.

References itpp::pow(), and itpp::Vec< Num_T >::size().

double itpp::norm const cvec v,
const std::string &  s
 

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

Definition at line 98 of file stat.cpp.

References itpp::norm().

template<class T>
double itpp::norm const Vec< T > &  v,
const std::string &  s
 

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

Definition at line 421 of file stat.h.

References it_assert, itpp::Vec< Num_T >::size(), itpp::sqr(), and itpp::sqrt().

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 107 of file stat.cpp.

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

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 123 of file stat.cpp.

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

double itpp::norm const mat m,
const std::string &  s
 

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

Definition at line 135 of file stat.cpp.

References itpp::diag(), it_assert, itpp::sqrt(), itpp::sum(), and itpp::transpose().

double itpp::norm const cmat m,
const std::string &  s
 

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

Definition at line 142 of file stat.cpp.

References itpp::diag(), itpp::hermitian_transpose(), it_assert, itpp::real(), itpp::sqrt(), and itpp::sum().

double itpp::variance const cvec v  ) 
 

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

Definition at line 149 of file stat.cpp.

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

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

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 464 of file stat.h.

References itpp::Vec< Num_T >::_data(), itpp::Vec< Num_T >::size(), and itpp::sum().

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 480 of file stat.h.

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

Referenced by itpp::house(), itpp::sd(), itpp::spectrum(), itpp::sqtrain(), and itpp::xcorr_old().

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 487 of file stat.h.

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 493 of file stat.h.

References itpp::abs().

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 499 of file stat.h.

References itpp::abs(), and max.

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 505 of file stat.h.

References itpp::abs(), and max.

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 511 of file stat.h.

References itpp::abs(), and max.

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 517 of file stat.h.

References itpp::abs(), and max.

double itpp::moment const vec x,
const int  r
 

Calculate the central moment of vector x.

The $r$th sample central moment of the samples in the vector $ \mathbf{x} $ is defined as

\[ m_r = \mathrm{E}[x-\mu]^r = \frac{1}{n} \sum_{i=0}^{n-1} (x_i - \mu)^r \]

where $\mu$ is the sample mean.

Definition at line 164 of file stat.cpp.

References itpp::mean(), and itpp::pow().

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

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 $ \mathbf{x} $ is

\[ \gamma_1 = \frac{\mathrm{E}[x-\mu]^3}{\sigma^3} \]

where $\mu$ is the mean and $\sigma$ the standard deviation.

The skewness is estimated as

\[ \gamma_1 = \frac{k_3}{{k_2}^{3/2}} \]

where

\[ k_2 = \frac{n}{n-1} m_2 \]

and

\[ k_3 = \frac{n^2}{(n-1)(n-2)} m_3 \]

Here $m_2$ is the sample variance and $m_3$ is the 3rd sample central moment.

Definition at line 200 of file stat.cpp.

References itpp::moment(), itpp::pow(), and itpp::variance().

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

\[ \gamma_2 = \frac{\mathrm{E}[x-\mu]^4}{\sigma^4} - 3 \]

where $\mu$ is the mean and $\sigma$ the standard deviation.

The kurtosis excess is estimated as

\[ \gamma_2 = \frac{k_4}{{k_2}^2} \]

where

\[ k_2 = \frac{n}{n-1} m_2 \]

and

\[ k_4 = \frac{n^2 [(n+1)m_4 - 3(n-1){m_2}^2]}{(n-1)(n-2)(n-3)} \]

Here $m_2$ is the sample variance and $m_4$ is the 4th sample central moment.

Definition at line 210 of file stat.cpp.

References itpp::moment(), and itpp::variance().

Referenced by itpp::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

\[ \gamma_2 = \frac{\mathrm{E}[x-\mu]^4}{\sigma^4} \]

where $\mu$ is the mean and $\sigma$ the standard deviation. For a Gaussian variable, the kurtusis is 3.

See also the definition of kurtosisexcess.

Definition at line 606 of file stat.h.

References itpp::kurtosisexcess().

SourceForge Logo

Generated on Thu Apr 19 14:20:40 2007 for IT++ by Doxygen 1.4.6