STK++ 0.9.13
|
It's very easy to center a data set using high level template expressions and statistical functors.
Consider the following code and its output:
Example: | Output: |
---|---|
#include "STKpp.h"
using namespace STK;
{
Law::Normal law(1,2);
A.rand(law);
// call column statistical functions
// center the array
// call column statistical functions with all the columns of A centered
}
This file include all the header files of the STK++ project. The MultidimRegression class allows to regress a multidimensional output variable among a multivariat... Definition STK_MultidimRegression.h:52 The namespace STK is the main domain space of the Statistical ToolKit project. | min(A) =-4.66112 -3.1092 -2.76891 -4.65294 -5.47609 max(A) =4.17889 5.89107 5.08115 6.39462 5.17813 max(A.abs()) =4.66112 5.89107 5.08115 6.39462 5.47609 mean(A) =0.963606 1.26585 1.26198 1.05056 0.723175 Centering... min(A) =-5.62472 -4.37505 -4.0309 -5.7035 -6.19926 max(A) =3.21529 4.62522 3.81916 5.34406 4.45495 max(A.abs()) =5.62472 4.62522 4.0309 5.7035 6.19926 mean(A) =2.57572e-16 -3.93019e-16 2.13163e-16 -3.4639e-16 -1.15463e-16 |
The expression
represents the matrix multiplication of a column vector of 1 with 100 rows and of row vector with the mean of each column of A.
A
we can get the maximal value in absolute value using max
(A.abs()). It is possible to use functors mixed with unary or binary operators.