input M x N matrix, each row an observation and each column mean centred
column standard deviation
estimation method
M x N matrix with each column divided by it's standard deviation
import mir.ndslice; import mir.math; auto data = mininitRcslice!double(2,2); data[] = [[ 2, -1], [-2, 1]]; //sd1 = 2 * sqrt(2.0); //sd2 = sqrt(2.0); auto x = 1.0 / sqrt(2.0); auto scaled = mininitRcslice!double(2,2); scaled[] = [[ x, -x], [-x, x]]; auto stdDev = mininitRcslice!double(2); assert(normalizeColumns(data, stdDev) == scaled); assert(stdDev == [2*sqrt(2.0), sqrt(2.0)]);
Normalization of raw data.