> module VarianceNormalization(normalizeRowVariance) > where > import NumericUtilities(standardDeviation) divide row elements by the standard deviation of their row > normalizeRowVariance :: RealFloat r => [[r]] -> [[r]] > normalizeRowVariance rows = > zipWith (sequenceOp divide) sds rows > where > sds = map standardDeviation rows > divide sd rowElement = rowElement/sd sequenceOp op x [y1, y2, ...] = [x `op` y1, x `op` y2, ...] > sequenceOp :: (a -> b -> c) -> a -> [b] -> [c] > sequenceOp scalarOp scalar = map(scalarOp scalar)