STK++ 0.9.13
tutoStatTransform.cpp File Reference
#include "STKpp.h"
Include dependency graph for tutoStatTransform.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 3 of file tutoStatTransform.cpp.

4{
7 Law::Normal law(1,2);
8 A.rand(law);
9 stk_cout << "mean(A)=\n" << (mu=Stat::mean(A));
10 stk_cout << "variance(A)=\n"
11 << Stat::varianceWithFixedMean(A, mu, false)<<"\n";
12 // standardize using empirical mean and standard deviation (std is computed during)
13 Stat::standardize(A, mu, std);
14 stk_cout << "mean(A)=\n" << (mean=Stat::mean(A));
15 stk_cout << "variance(A)=\n"
16 << Stat::varianceWithFixedMean(A, mean, false)<<"\n";
17 // undo standardization
18 Stat::unstandardize(A, mu, std);
19 stk_cout << "mean(A)=\n" << (mean=Stat::mean(A));
20 stk_cout << "variance(A)=\n"
22
23 return 0;
24}
#define stk_cout
Standard stk output stream.
Normal distribution law.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
hidden::SliceVisitorSelector< Derived, hidden::MeanVisitor, Arrays::by_col_ >::type_result mean(Derived const &A)
If A is a row-vector or a column-vector then the function will return the usual mean value of the vec...
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Row varianceWithFixedMean(Derived const &A, MeanType const &mean, bool unbiased)
Compute the VarianceWithFixedMean(s) value(s) of A.
void unstandardize(Array &m, RowVector const &std)
undo the standardization by columns of the standardized variable m.
hidden::FunctorTraits< Derived, MeanOp >::Row mean(Derived const &A)
Compute the mean(s) value(s) of A.
void standardize(Array &m, RowVector &mean, RowVector &std, bool unbiased=false)
Compute the mean and the standard deviation by columns of the variable m and standardize it.

References STK::mean(), STK::Stat::mean(), STK::ArrayBase< Derived >::rand(), STK::Stat::standardize(), stk_cout, STK::Stat::unstandardize(), and STK::Stat::varianceWithFixedMean().