Matrix::ZScore Method

TMtx *ZScore(TMtx *Src) const;

Transforms matrix into matrix of standardized data.

#NameTypeDescription
1SrcTMtx *
Remarks:

The routine uses Data matrix and transforms it into ZScore matrix of standardized data (the so called Z Scores). The standardization of each column (variable) is made by subtracting its mean and dividing by its standard deviation:

Z(Column) = (Column - Mean(Column))/StdDev(Column)

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Matrix Data, Res;

    Data.SetIt(3, 3, false, DewArray<double>{1, 2, 3, 4, 5, 6, 7, 100, 12});
    Res.ZScore(Data);
    // Res = (-1    -0,604    -0,873,
    //            0    -0,55    -0,218
    //            1     1,154     1,091)
}
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler