public static MutableDoubleTuple standardize ( DoubleTuple t , MutableDoubleTuple result ) { result = DoubleTuples . validate ( t , result ) ; double mean = arithmeticMean ( t ) ; double standardDeviation = standardDeviationFromMean ( t , mean ) ; double invStandardDeviation = 1.0 / standardDeviation ; return DoubleTupleFunctions . apply ( t , ( a ) - > ( ( a - mean ) * invStandardDeviation ) , result ) ; }
Standardize the given tuple . This means that the mean of the elements is subtracted from them and they are divided by the standard deviation .