public void inferenceModel(Documents docSet) throws IOException {
        //use em to estimate params
        //save model according to model parameters
        
        if (iters < saveStep + beginSaveIters) {
			System.err.println("Error: the number of iterations should be larger than "
							+ (saveStep + beginSaveIters));
			System.exit(0);
		}
		for (int i = 0; i < iters; i++) {
			System.out.println("Interation " + i + " -------------- ");
			if ((i >= beginSaveIters)
					&& (((i - beginSaveIters) % saveStep) == 0)) {
				// Saving the model
				System.out.println("Saving model at iteration " + i + " ... ");
				saveIteratedModel(i, docSet);
			}
            em();
            System.out.println("After E step and M step, the new log likelihood is " + computeLogLikelihood(docSet));
        }

        System.out.println("done");
    }