Program: 189560
Project: 189560
Buggy source:
/** 
 * XXX: the state must have a prior predictive mean.
 * @param obs
 * @param state
 * @return
 */
public InferredPathEntry getPredictiveLogLikelihood(Observation obs,VehicleState state){
  final MultivariateGaussian beliefPrediction=state.getBelief().clone();
  final StandardRoadTrackingFilter filter=state.getMovementFilter();
  PathEdge prevEdge=PathEdge.getEdge(state.getInferredEdge());
  double pathLogLik=Double.NEGATIVE_INFINITY;
  final Map<PathEdge,DefaultWeightedValue<MultivariateGaussian>> edgeToPredictiveBeliefAndLogLikelihood=Maps.newHashMap();
  for (  final PathEdge edge : this.getEdges()) {
    final MultivariateGaussian edgeBelief=beliefPrediction.clone();
    final double edgePredMarginalLogLik;
    if (edge.isEmptyEdge()) {
      filter.predict(edgeBelief,edge,prevEdge);
      edgePredMarginalLogLik=0d;
    }
 else {
      edge.predict(edgeBelief,obs);
      edgePredMarginalLogLik=edge.marginalPredictiveLogLikelihood(beliefPrediction);
    }
    final double edgePredTransLogLik=state.getEdgeTransitionDist().predictiveLogLikelihood(prevEdge.getInferredEdge(),edge.getInferredEdge());
    final double localPosVelPredLogLik=filter.logLikelihood(obs.getProjectedPoint(),edgeBelief,edge);
    final double localLogLik=edgePredMarginalLogLik + edgePredTransLogLik + localPosVelPredLogLik;
    Preconditions.checkArgument(!Double.isNaN(localLogLik));
    edgeToPredictiveBeliefAndLogLikelihood.put(edge,new DefaultWeightedValue<MultivariateGaussian>(edgeBelief.clone(),localLogLik));
    pathLogLik=LogMath.add(pathLogLik,localLogLik);
    prevEdge=edge;
  }
  return new InferredPathEntry(this,edgeToPredictiveBeliefAndLogLikelihood,filter,pathLogLik);
}

Fixed version (ground truth):
/** 
 * XXX: the state must have a prior predictive mean.
 * @param obs
 * @param state
 * @return
 */
public InferredPathEntry getPredictiveLogLikelihood(Observation obs,VehicleState state){
  final MultivariateGaussian beliefPrediction=state.getBelief().clone();
  final StandardRoadTrackingFilter filter=state.getMovementFilter();
  filter.predict(beliefPrediction,this.getEdges().get(0),PathEdge.getEdge(state.getInferredEdge()));
  PathEdge prevEdge=PathEdge.getEdge(state.getInferredEdge());
  double pathLogLik=Double.NEGATIVE_INFINITY;
  final Map<PathEdge,DefaultWeightedValue<MultivariateGaussian>> edgeToPredictiveBeliefAndLogLikelihood=Maps.newHashMap();
  for (  final PathEdge edge : this.getEdges()) {
    final MultivariateGaussian edgeBelief=beliefPrediction.clone();
    final double edgePredMarginalLogLik;
    if (edge.isEmptyEdge()) {
      filter.predict(edgeBelief,edge,prevEdge);
      edgePredMarginalLogLik=0d;
    }
 else {
      edge.predict(edgeBelief,obs);
      edgePredMarginalLogLik=edge.marginalPredictiveLogLikelihood(beliefPrediction);
    }
    final double edgePredTransLogLik=state.getEdgeTransitionDist().predictiveLogLikelihood(prevEdge.getInferredEdge(),edge.getInferredEdge());
    final double localPosVelPredLogLik=filter.logLikelihood(obs.getProjectedPoint(),edgeBelief,edge);
    final double localLogLik=edgePredMarginalLogLik + edgePredTransLogLik + localPosVelPredLogLik;
    Preconditions.checkArgument(!Double.isNaN(localLogLik));
    edgeToPredictiveBeliefAndLogLikelihood.put(edge,new DefaultWeightedValue<MultivariateGaussian>(edgeBelief.clone(),localLogLik));
    pathLogLik=LogMath.add(pathLogLik,localLogLik);
    prevEdge=edge;
  }
  return new InferredPathEntry(this,beliefPrediction,edgeToPredictiveBeliefAndLogLikelihood,filter,pathLogLik);
}