Beispiel #1
0
        /// <summary>EP message to <c>ch</c>.</summary>
        /// <param name="concat">Incoming message from <c>concat</c>.</param>
        /// <param name="str">Incoming message from <c>str</c>.</param>
        /// <returns>The outgoing EP message to the <c>ch</c> argument.</returns>
        /// <remarks>
        ///   <para>The outgoing message is a distribution matching the moments of <c>ch</c> as the random arguments are varied. The formula is <c>proj[p(ch) sum_(concat,str) p(concat,str) factor(concat,ch,str)]/p(ch)</c>.</para>
        /// </remarks>
        public static DiscreteChar ChAverageConditional(StringDistribution concat, StringDistribution str)
        {
            var result = StringConcatOp.Str1AverageConditional(concat, str);

            return(SingleOp.CharacterAverageConditional(result));
        }
Beispiel #2
0
 /// <summary>EP message to <c>str</c>.</summary>
 /// <param name="concat">Incoming message from <c>concat</c>.</param>
 /// <param name="ch">Incoming message from <c>ch</c>.</param>
 /// <returns>The outgoing EP message to the <c>str</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is a distribution matching the moments of <c>str</c> as the random arguments are varied. The formula is <c>proj[p(str) sum_(concat,ch) p(concat,ch) factor(concat,str,ch)]/p(str)</c>.</para>
 /// </remarks>
 public static StringDistribution StrAverageConditional(StringDistribution concat, DiscreteChar ch)
 {
     return(StringConcatOp.Str1AverageConditional(concat, StringDistribution.Char(ch)));
 }