docs: public SufficientStatistics train(ParametricFactorGraph bn, List<DynamicAssignment> trainingData) {
      // Instantiate a factor graph using an arbitrary set of parameters.
      // We must instantiate a graph in order to handle dynamic factor graphs,
      // as dynamic factor graphs have assignments of variable size. 
      SufficientStatistics parameters = bn.getNewSufficientStatistics();
      DynamicFactorGraph factorGraph = bn.getModelFromParameters(parameters);
  
      // Compute sufficient statistics for all examples in parallel.
      SufficientStatisticsBatch result = MapReduceConfiguration.getMapReduceExecutor()
          .mapReduce(trainingData,
              new SufficientStatisticsMapper(factorGraph, new AssignmentMarginalCalculator(), new NullLogFunction()),
              new SufficientStatisticsReducer(bn, parameters));
      return result.getStatistics();
    }