35#ifndef STK_STAT_COVARIANCE_H
36#define STK_STAT_COVARIANCE_H
54template<
class XArray,
class YArray>
66#ifdef STK_BOUNDS_CHECK
67 if (
X.range() !=
Y.range())
73 for (
int i=
X.begin();
i<
X.end();
i++)
97template<
class XArray,
class YArray>
109 #ifdef STK_BOUNDS_CHECK
110 if (
X.range() !=
Y.range())
117 for (
int i=
X.begin();
i<
X.end();
i++)
152template<
class XArray,
class YArray,
class Weights>
166#ifdef STK_BOUNDS_CHECK
167 if (
X.range() !=
Y.range())
173 for (
int i=
X.begin();
i<
X.end();
i++)
207template<
class XArray,
class YArray,
class Weights>
221#ifdef STK_BOUNDS_CHECK
222 if (
X.range() !=
Y.range())
229 for (
int i=
X.begin();
i<
X.end();
i++)
263template<
class XArray,
class YArray>
277#ifdef STK_BOUNDS_CHECK
278 if (
X.range() !=
Y.range())
284 for (
int i=
X.begin();
i<
X.end();
i++)
311template<
class XArray,
class YArray>
325 #ifdef STK_BOUNDS_CHECK
326 if (
X.range() !=
Y.range())
332 for (
int i=
X.begin();
i<
X.end();
i++)
370template<
class XArray,
class YArray,
class Weights>
386#ifdef STK_BOUNDS_CHECK
387 if (
X.range() !=
Y.range())
392 for (
int i=
X.begin();
i<
X.end();
i++)
427template<
class XArray,
class YArray,
class Weights>
443#ifdef STK_BOUNDS_CHECK
444 if (
X.range() !=
Y.range())
450 for (
int i=
X.begin();
i<
X.end();
i++)
482template <
class Array >
491 for (
int j= cov_.begin();
j< cov_.end();
j++)
494 for (
int i= cov_.begin();
i<
j;
i++)
509template <
class Array >
517 for (
int j= cov_.begin();
j< cov_.end();
j++)
520 for (
int i= cov_.begin();
i<
j;
i++)
535template <
class Array,
class Weights >
543 for (
int j= cov_.begin();
j< cov_.end();
j++)
546 for (
int i= cov_.begin();
i<
j;
i++)
561template <
class Array,
class Weights >
568 for (
int j= cov_.begin();
j< cov_.end();
j++)
571 for (
int i= cov_.begin();
i<
j;
i++)
587template <
class Array,
class Mean >
591#ifdef STK_BOUNDS_CHECK
595 for (
int j= cov_.begin();
j< cov_.end();
j++)
598 for (
int i= cov_.begin();
i<
j;
i++)
614template <
class Array,
class Mean >
618#ifdef STK_BOUNDS_CHECK
622 for (
int j= cov_.begin();
j< cov_.end();
j++)
625 for (
int i= cov_.begin();
i<
j;
i++)
641template <
class Array,
class Weights,
class Mean >
645#ifdef STK_BOUNDS_CHECK
651 for (
int j= cov_.begin();
j< cov_.end();
j++)
654 for (
int i= cov_.begin();
i<
j;
i++)
670template <
class Array,
class Weights,
class Mean >
674#ifdef STK_BOUNDS_CHECK
680 for (
int j= cov_.begin();
j< cov_.end();
j++)
683 for (
int i= cov_.begin();
i<
j;
i++)
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
This file contain the functors computings statistics.
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
double Real
STK fundamental type of Real values.
CArraySquare< typename Array::Type, Array::sizeRows_, Array::orient_ > covarianceByRow(ExprBase< Array > const &V, bool unbiased=false)
Compute the covariance matrix using the rows of the data set V.
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Row varianceWithFixedMean(Derived const &A, MeanType const &mean, bool unbiased)
Compute the VarianceWithFixedMean(s) value(s) of A.
Real covarianceSafe(ExprBase< XArray > const &X, ExprBase< YArray > const &Y, bool unbiased=false)
Compute the covariance of the variables X and Y.
CArraySquare< typename Array::Type, Array::sizeRows_, Array::orient_ > covarianceWithFixedMeanByRow(ExprBase< Array > const &V, ExprBase< Mean > const &mean, bool unbiased=false)
Compute the covariance matrix using the rows of the data set V.
hidden::FunctorTraits< Derived, MeanOp >::Row mean(Derived const &A)
Compute the mean(s) value(s) of A.
Real covariance(ExprBase< XArray > const &X, ExprBase< YArray > const &Y, bool unbiased=false)
Compute the covariance of the variables X and Y.
Real covarianceWithFixedMean(ExprBase< XArray > const &X, ExprBase< YArray > const &Y, typename hidden::Traits< XArray >::Type const &xMu, typename hidden::Traits< YArray >::Type const &yMu, bool unbiased=false)
Compute the covariance of the variables X and Y with fixed means.
Real covarianceWithFixedMeanSafe(ExprBase< XArray > const &X, ExprBase< YArray > const &Y, typename hidden::Traits< XArray >::Type const &xMu, typename hidden::Traits< YArray >::Type const &yMu, bool unbiased=false)
Compute the covariance of the variables X and Y with fixed means.
hidden::FunctorTraits< Derived, MeanOp >::Col meanByRow(Derived const &A)
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.
static bool isFinite(Type const &x)