Displaying differences for changeset |
@@ -161,9 +161,7 @@ |
throw new IllegalArgumentException("obs/sim length differ: " + obs.length + "!=" + sim.length); |
} |
- /** |
- * calculating logarithmic values of both data sets. Sets 0 if data is 0 |
- */ |
+ // calculating logarithmic values of both data sets. |
double[] log_sim = new double[sim.length]; |
double[] log_obs = new double[sim.length]; |
@@ -190,9 +188,12 @@ |
valid++; |
} |
+ if (valid < 2) { |
+ return Double.NEGATIVE_INFINITY; |
+ } |
+ |
// calculating mean |
double mean_log_obs = sum_log_obs / valid; |
- |
// calculating mean pow deviations |
double sum1 = 0.0; |
double sum_mean = 0.0; |