@SuppressWarnings({"SuspiciousNameCombination"}) public double logMarginalLikelihoodSmoothed(List<Double> v,double delta,double Pdata){
  final double logDelta=StrictMath.log(delta);
  final double logInvDelta=StrictMath.log(1.0 - delta);
  final int n=v.size();
  final double logN=StrictMath.log(n);
  final double offset=logInvDelta - Pdata;
  double bottom=logN + logDelta - logInvDelta;
  double top=bottom + Pdata;
  for (int i=0; i < n; i++) {
    double weight=-LogTricks.logSum(logDelta,offset + v.get(i));
    top=LogTricks.logSum(top,weight + v.get(i));
    bottom=LogTricks.logSum(bottom,weight);
  }
  return top - bottom;
}

@ SuppressWarnings ( { "SuspiciousNameCombination" } ) public double logMarginalLikelihoodSmoothed ( List < Double > v , double delta , double Pdata ) { final double logDelta = StrictMath . log ( delta ) ; final double logInvDelta = StrictMath . log ( 1.0 - delta ) ; final int n = v . size ( ) ; final double logN = StrictMath . log ( n ) ; final double offset = logInvDelta - Pdata ; double bottom = logN + logDelta - logInvDelta ; double top = bottom + Pdata ; for ( int i = 0 ; i < n ; i ++ ) { double weight = - LogTricks . logSum ( logDelta , offset + v . get ( i ) ) ; top = LogTricks . logSum ( top , weight + v . get ( i ) ) ; bottom = LogTricks . logSum ( bottom , weight ) ; } return top - bottom ; }
calculates the log marginal likelihood of a model using newton and raftery ' s smoothed estimator
