/// <summary>EP message to <c>probTrue</c>.</summary>
        /// <param name="sample">Incoming message from <c>sample</c>. Must be a proper distribution. If any element is uniform, the result will be uniform.</param>
        /// <param name="probTrue">Incoming message from <c>probTrue</c>.</param>
        /// <param name="result">Modified to contain the outgoing message.</param>
        /// <returns>
        ///   <paramref name="result" />
        /// </returns>
        /// <remarks>
        ///   <para>The outgoing message is a distribution matching the moments of <c>probTrue</c> as the random arguments are varied. The formula is <c>proj[p(probTrue) sum_(sample) p(sample) factor(sample,probTrue)]/p(probTrue)</c>.</para>
        /// </remarks>
        /// <exception cref="ImproperMessageException">
        ///   <paramref name="sample" /> is not a proper distribution.</exception>
        public static SparseBetaList ProbTrueAverageConditional([SkipIfUniform] BernoulliIntegerSubset sample, SparseBetaList probTrue, SparseBetaList result)
        {
            Func <Bernoulli, Beta, Beta> f = BernoulliFromBetaOp.ProbTrueAverageConditional;

            result.SetTo(f.Map(sample.SparseBernoulliList, probTrue));
            return(result);
        }