code: public double max(double[] series) {
      double max = Double.MIN_VALUE;
      for (int i = 0; i < series.length; i++) {
        if (max < series[i]) {
          max = series[i];
        }
      }
      return max;
    }
docs: Finds the maximal value in timeseries.
  
  @param series The timeseries.
  @return The max value.