question: public BayesIm maximization ( double threshhold ) { double distance = Double . MAX_VALUE ; BayesIm oldBayesIm = estimatedIm ; BayesIm newBayesIm = null ; while ( Double . isNaN ( distance ) || distance > threshhold ) { expectation ( oldBayesIm ) ; newBayesIm = getEstimatedIm ( ) ; distance = BayesImDistanceFunction . distance ( newBayesIm , oldBayesIm ) ; oldBayesIm = newBayesIm ; } return newBayesIm ; }
target:  This method iteratively estimates the parameters of the Bayes net using the dataset until the parameters don't change.  That is, the newly estimated parameters are used in the estimate method to produce even more accurate parameters (with respect to the dataset) etc.  The threshhold is compared to the distance between successive parameter sets and when the change is less than the threshhold, the process is considered to have converged.  The distance between successive Bayes nets is the Euclidean distance between vectors of sequences of their parameters.  See the BayesImDistanceFunction class for details.