question: public static double mad ( final double [ ] data ) { double mad = 0 ; if ( data . length > 0 ) { double median = median ( data ) ; double [ ] deviationSum = new double [ data . length ] ; for ( int i = 0 ; i < data . length ; i ++ ) { deviationSum [ i ] = Math . abs ( median - data [ i ] ) ; } mad = median ( deviationSum ) ; } return mad ; }
target:  Gets the Median absolute deviation (MAD) from a array of numbers.