Displaying differences for changeset
 
display as  

src/java/m/oms/ages/V1_0.java

@@ -25,6 +25,7 @@
 import ngmf.util.cosu.luca.of.TRMSE;
 import oms.utils.Utils;
 import oms3.ObjectiveFunction;
+import oms3.util.Statistics;
 
 /**
  * Ages service.
@@ -50,6 +51,23 @@
 
   static Map<String, ObjectiveFunction> OF = new HashMap<>();
 
+  /**
+   *
+   */
+  static class PBIAS implements ObjectiveFunction {
+
+    @Override
+    public double calculate(double[] obs, double[] sim, double missing) {
+      return Statistics.pbias(obs, sim, missing);
+    }
+
+
+    @Override
+    public boolean positiveDirection() {
+      return false;
+    }
+  }
+
 
   static {
     OF.put("kge", new KGE());
@@ -57,6 +75,7 @@
     OF.put("nslog", new NS2LOG());
     OF.put("rmse", new RMSE());
     OF.put("trmse", new TRMSE());
+    OF.put("pbias", new PBIAS());
   }
 
   // required parameter