I am not sure if this will give you an exact solution. But you can get these functions using the apache math library. This is an example of obtaining the average absolute deviation.
public double mad(double [] autoCorrelationValues){ double [] tempTable = new double[autoCorrelationValues.length]; Median m = new Median(); double medianValue = m.evaluate(autoCorrelationValues); for(int i=0 ; i<autoCorrelationValues.length ;i++){ tempTable[i] = Math.abs(autoCorrelationValues[i] - medianValue); } return m.evaluate(tempTable); }
source share