Example #1
0
        /// <summary>
        ///   Estimates a new mixture model from a given set of observations.
        /// </summary>
        ///
        /// <param name="data">A set of observations.</param>
        /// <param name="coefficients">The initial mixture coefficients.</param>
        /// <param name="threshold">The convergence threshold for the Expectation-Maximization estimation.</param>
        /// <param name="components">The initial components of the mixture model.</param>
        /// <returns>Returns a new Mixture fitted to the given observations.</returns>
        ///
        public static Mixture <T> Estimate(double[] data, double threshold, double[] coefficients, params T[] components)
        {
            var mixture = new Mixture <T>(coefficients, components);

            mixture.Fit(data, new MixtureOptions(threshold));
            return(mixture);
        }
Example #2
0
        /// <summary>
        ///   Estimates a new mixture model from a given set of observations.
        /// </summary>
        ///
        /// <param name="data">A set of observations.</param>
        /// <param name="coefficients">The initial mixture coefficients.</param>
        /// <param name="components">The initial components of the mixture model.</param>
        /// <returns>Returns a new Mixture fitted to the given observations.</returns>
        ///
        public static Mixture <T> Estimate(double[] data, double[] coefficients, params T[] components)
        {
            var mixture = new Mixture <T>(coefficients, components);

            mixture.Fit(data);
            return(mixture);
        }