docs: public static DiscreteFactor getMeans(Collection<DiscreteFactor> featureFactors,
        int featureVariableNum) {
      Preconditions.checkArgument(featureFactors.size() > 0);
      DiscreteFactor sums = null;
      int numEntries = 0;
      for (DiscreteFactor featureFactor : featureFactors) {
        // Calculate the number of feature vectors contained in this factor.
        VariableNumMap nonFeatureVars = featureFactor.getVars().removeAll(featureVariableNum);
        numEntries += nonFeatureVars.getNumberOfPossibleAssignments();
        
        DiscreteFactor featureSums = featureFactor.marginalize(nonFeatureVars);
        if (sums == null) {
          sums = featureSums;
        } else {
          sums = sums.add(featureSums);
        }
      }
  
      return sums.product(1.0 / numEntries);    
    }