/// <summary> /// EP message to 'fromArray' /// </summary> /// <param name="array">Incoming message from 'data'. Must be a proper distribution. If all elements are uniform, the result will be uniform.</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 'fromArray' as the random arguments are varied. /// The formula is <c>proj[p(fromArray) sum_(data) p(data) factor(fromArray,data)]/p(fromArray)</c>. /// </para></remarks> /// <exception cref="ImproperMessageException"><paramref name="array"/> is not a proper distribution</exception> // TM: SkipIfAllUniform would be more accurate but leads to half-uniform distributions public static VectorGaussian VectorAverageConditional([SkipIfAnyUniform] IList <Gaussian> array, VectorGaussian result) { return(ArrayFromVectorOp.VectorAverageConditional(array, result)); }
/// <summary>EP message to <c>fromArray</c>.</summary> /// <param name="array">Incoming message from <c>data</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>fromArray</c> as the random arguments are varied. The formula is <c>proj[p(fromArray) sum_(data) p(data) factor(fromArray,data)]/p(fromArray)</c>.</para> /// </remarks> public static VectorGaussian VectorAverageConditional( [SkipIfAnyUniform] IList <Gaussian> array, VectorGaussian result) // TM: SkipIfAllUniform would be more accurate but leads to half-uniform distributions { return(ArrayFromVectorOp.VectorAverageConditional(array, result)); }