code: public static double ioa(double[] obs, double[] sim, double pow) {
          sameArrayLen(obs, sim);
          int steps = sim.length;
  
          double sum_obs = 0;
  
          /**summing up both data sets */
          for (int i = 0; i < steps; i++) {
              sum_obs += obs[i];
          }
  
          /** calculating mean values for both data sets */
          double mean_obs = sum_obs / steps;
  
          /** calculating mean cubic deviations */
          /** calculating absolute squared sum of deviations from verification mean */
          double td_vd = 0;
          double abs_sqDevi = 0;
          for (int i = 0; i < steps; i++) {
              td_vd +=  (Math.pow((Math.abs(obs[i] - sim[i])), pow));
              abs_sqDevi +=  Math.pow(Math.abs(sim[i] - mean_obs) + Math.abs(obs[i] - mean_obs), pow);
          }
          return 1.0 - (td_vd / abs_sqDevi);
      }
docs: Calculates the index of agreement (ioa) between a test data set and a verification data set
  after Willmot & Wicks (1980). The ioa is described as the proportion of
  the cumulated cubic deviation between both data sets and the squared sum of the absolute
  deviations between the verification data set and the test mean value and the test data set and
  its mean value.
  @param sim the test Data set
  @param obs the verification data set
  @param pow the power
  @return the calculated ioa or -9999 if an error occurs