code: public double meanSquaredError(OutputVariable outputVariable) {
          if (!canComputeErrors()) {
              return Double.NaN;
          }
  
          double mse = 0.0;
          int errors = 0;
          final int offset = engine.numberOfInputVariables();
          for (int i = 0; i < expected.size(); ++i) {
              double[] e = expected.get(i);
              double[] o = obtained.get(i);
              for (int y = 0; y < engine.numberOfOutputVariables(); ++y) {
                  if (outputVariable == null
                          || outputVariable == engine.getOutputVariable(y)) {
                      double difference = e[offset + y] - o[offset + y];
                      if (Op.isFinite(difference)
                              && !Op.isEq(difference, 0.0, tolerance)) {
                          mse += difference * difference;
                          ++errors;
                      }
                  }
              }
          }
  
          if (errors > 0) {
              mse /= errors;
          }
          return mse;
      }
docs: Computes the mean squared error of the given output variable considering
  only those cases where there is an accuracy error as defined in
  Benchmark::accuracyErrors().
  
  @param outputVariable is the output variable to compute the errors for
  @return the mean squared error over the given output variable.