Esempio n. 1
0
 public static Gaussian ArrayAverageConditional <GaussianList>([SkipIfUniform] Gaussian sum, [Proper] IList <Gaussian> array, int resultIndex)
 {
     // when using ProductOp_SHG09 as the parent, 'array' is already the marginal
     //      return FastSumOp.ArrayAverageLogarithm2(sum, array, to_array);
     return(FastSumOp.ArrayAverageLogarithm7(sum, array, resultIndex));
 }
Esempio n. 2
0
        /// <summary>EP message to <c>array</c>.</summary>
        /// <param name="sum">Constant value for <c>sum</c>.</param>
        /// <param name="array">Incoming message from <c>array</c>. Must be a proper distribution. If the element at resultIndex is uniform, the result will be uniform.</param>
        /// <param name="resultIndex">Index of the <c>array</c> for which a message is desired.</param>
        /// <returns>The outgoing EP message to the <c>array</c> argument.</returns>
        /// <remarks>
        ///   <para>The outgoing message is the factor viewed as a function of <c>array</c> conditioned on the given values.</para>
        /// </remarks>
        /// <exception cref="ImproperMessageException">
        ///   <paramref name="array" /> is not a proper distribution.</exception>
        public static Gaussian ArrayAverageConditional([SkipIfUniform] double sum, [Proper, MatchingIndex] IList <Gaussian> array, int resultIndex)
        {
            Gaussian to_sum = FastSumOp.SumAverageConditional(array);

            return(ArrayAverageConditional(Gaussian.PointMass(sum), to_sum, array, resultIndex));
        }