33 arma::vec normalized = X;
34 double mean = arma::mean(normalized);
35 double std_dev = arma::stddev(X);
36 normalized -= mean * arma::ones(normalized.n_elem);
37 normalized /= std_dev;
48 arma::mat normalized = X;
49 arma::rowvec means = arma::mean(X);
50 arma::rowvec std_devs = arma::stddev(X);
51 normalized.each_row() -= means;
52 std_devs.transform( [](
double val){
return 1.0 / val;});
53 return normalized * arma::diagmat(std_devs);
68 arma::rowvec weights = arma::stddev(X, 0) + offset*arma::ones(1, X.n_cols);
69 weights.transform( [](
double val){
return 1.0 / val;});
71 arma::rowvec means = arma::mean(X);
72 X_cpy.each_row() -= means;
74 return X_cpy * arma::diagmat(weights);
VESPUCCI_EXPORT arma::mat StandardScoreMat(const arma::mat &X)
Vespucci::Math::Normalization::StandardScore.
VESPUCCI_EXPORT arma::vec StandardScore(const arma::vec &X)
Vespucci::Math::Normalization::StandardScore.
VESPUCCI_EXPORT arma::mat SNVNorm(const arma::mat &X, const double offset, bool center)
Vespucci::Math::Normalization::SNVNorm.