Esempio n. 1
0
 /// <summary>VMP message to <c>choice</c>.</summary>
 /// <param name="sample">Incoming message from <c>sample</c>.</param>
 /// <param name="probTrue">Constant value for <c>probTrue</c>.</param>
 /// <returns>The outgoing VMP message to the <c>choice</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except <c>choice</c>. The formula is <c>exp(sum_(sample) p(sample) log(factor(sample,choice,probTrue)))</c>.</para>
 /// </remarks>
 public static Bernoulli ChoiceAverageLogarithm(Bernoulli sample, double[] probTrue)
 {
     return(BernoulliFromBooleanOp.ChoiceAverageLogarithm(sample, probTrue[0], probTrue[1]));
 }
Esempio n. 2
0
 /// <summary>EP message to <c>choice</c>.</summary>
 /// <param name="sample">Incoming message from <c>sample</c>.</param>
 /// <param name="probTrue">Constant value for <c>probTrue</c>.</param>
 /// <returns>The outgoing EP message to the <c>choice</c> argument.</returns>
 /// <remarks>
 ///   <para>The outgoing message is a distribution matching the moments of <c>choice</c> as the random arguments are varied. The formula is <c>proj[p(choice) sum_(sample) p(sample) factor(sample,choice,probTrue)]/p(choice)</c>.</para>
 /// </remarks>
 public static Bernoulli ChoiceAverageConditional(Bernoulli sample, double[] probTrue)
 {
     return(BernoulliFromBooleanOp.ChoiceAverageConditional(sample, probTrue[0], probTrue[1]));
 }