/// <summary>Gibbs message to <c>probTrue</c>.</summary> /// <param name="sample">Constant value for <c>sample</c>.</param> /// <param name="result">Modified to contain the outgoing message.</param> /// <returns> /// <paramref name="result" /> /// </returns> /// <remarks> /// <para>The outgoing message is the factor viewed as a function of <c>probTrue</c> conditioned on the given values.</para> /// </remarks> public static SparseBetaList ProbTrueConditional(IList <int> sample, SparseBetaList result) { result.SetToFunction(BernoulliIntegerSubset.SubsetToList(sample, result.Count), s => BernoulliFromBetaOp.ProbTrueConditional(s)); return(result); }
/// <summary>Gibbs message to <c>probTrue</c>.</summary> /// <param name="sample">Constant value for <c>sample</c>.</param> /// <param name="result">Modified to contain the outgoing message.</param> /// <returns> /// <paramref name="result" /> /// </returns> /// <remarks> /// <para>The outgoing message is the factor viewed as a function of <c>probTrue</c> conditioned on the given values.</para> /// </remarks> public static SparseBetaList ProbTrueConditional(ISparseList <bool> sample, SparseBetaList result) { result.SetToFunction(sample, s => BernoulliFromBetaOp.ProbTrueConditional(s)); return(result); }