/** * Constructor. The mixture model will be learned from the given data with the * EM algorithm. * @param mixture the initial guess of mixture. Components may have * different distribution form. * @param data the training data. */ public DiscreteExponentialFamilyMixture(List<Component> mixture, int[] data) { this(mixture); EM(components, data); }
/** * Standard EM algorithm which iteratively alternates * Expectation and Maximization steps until convergence. * * @param mixture the initial configuration. * @param x the input data. * @return log Likelihood */ double EM(List<Component> mixture, int[] x) { return EM(mixture, x, 0.2); }
/** * Standard EM algorithm which iteratively alternates * Expectation and Maximization steps until convergence. * * @param mixture the initial configuration. * @param x the input data. * @param gamma the regularization parameter. * @return log Likelihood */ double EM(List<Component> mixture, int[] x, double gamma) { return EM(mixture, x, gamma, Integer.MAX_VALUE); }