STK++ 0.9.13
tutoStatFunctors.cpp
Go to the documentation of this file.
1#include "STKpp.h"
2using namespace STK;
3int main(int argc, char** argv)
4{
5 CArray3X a(3,5); a.randGauss();
6 stk_cout << "Stat::mean(a)=\n" << Stat::mean(a);
7 stk_cout << "Stat::meanByRow(a)=\n"<< Stat::meanByRow(a);
8 stk_cout << "Stat::variance(a)=\n" << Stat::variance(a);
9 // compute the biased variance (divided by N=3) with mean fixed to 0
10 stk_cout << "Stat::varianceWithFixedMean(a,0,false)=\n"
12 a(1,2) = a(2,2) = Arithmetic<Real>::NA();
13 stk_cout << "Stat::meanSafe(a)=\n" << Stat::meanSafe(a);
14 stk_cout << "Stat::meanSafeByRow(a)=\n" << Stat::meanSafeByRow(a);
15 return 0;
16}
#define stk_cout
Standard stk output stream.
This file include all the header files of the STK++ project.
Derived & randGauss()
set random values to this using a standard gaussian law.
A CArray is a two dimensional array with a continuous storage like a C-array.
Definition STK_CArray.h:130
Define the constant point.
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Row varianceWithFixedMean(Derived const &A, MeanType const &mean, bool unbiased)
Compute the VarianceWithFixedMean(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanOp >::Row mean(Derived const &A)
Compute the mean(s) value(s) of A.
hidden::FunctorTraits< Derived, VarianceOp >::Row variance(Derived const &A, bool unbiased=false)
Compute the variance(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanSafeOp >::Row meanSafe(Derived const &A)
Compute safely the mean(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanSafeOp >::Col meanSafeByRow(Derived const &A)
hidden::FunctorTraits< Derived, MeanOp >::Col meanByRow(Derived const &A)
The namespace STK is the main domain space of the Statistical ToolKit project.
static Type NA()
Adding a Non Available (NA) special number.
int main(int argc, char **argv)