public double logMarginalLikelihoodArithmetic(List<Double> v){
  int size=v.size();
  double sum=LogTricks.logZero;
  for (int i=0; i < size; i++) {
    if (!Double.isNaN(v.get(i)) && !Double.isInfinite(v.get(i))) {
      sum=LogTricks.logSum(sum,v.get(i));
    }
 else {
      size--;
    }
  }
  return sum - StrictMath.log(size);
}

public double logMarginalLikelihoodArithmetic ( List < Double > v ) { int size = v . size ( ) ; double sum = LogTricks . logZero ; for ( int i = 0 ; i < size ; i ++ ) { if ( ! Double . isNaN ( v . get ( i ) ) && ! Double . isInfinite ( v . get ( i ) ) ) { sum = LogTricks . logSum ( sum , v . get ( i ) ) ; } else { size -- ; } } return sum - StrictMath . log ( size ) ; }
calculates the log marginal likelihood of a model using the arithmetic mean estimator
