/// <summary> /// EP message to 'data' /// </summary> /// <param name="vector">Incoming message from 'fromArray'. Must be a proper distribution. If any element is uniform, the result will be uniform.</param> /// <param name="array">Incoming message from 'data'.</param> /// <param name="to_vector">Outgoing message to 'vector'.</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 'data' as the random arguments are varied. /// The formula is <c>proj[p(data) sum_(fromArray) p(fromArray) factor(fromArray,data)]/p(data)</c>. /// </para></remarks> /// <exception cref="ImproperMessageException"><paramref name="vector"/> is not a proper distribution</exception> public static GaussianList ArrayAverageConditional <GaussianList>([SkipIfUniform] VectorGaussian vector, IList <Gaussian> array, [Fresh] VectorGaussian to_vector, GaussianList result) where GaussianList : IList <Gaussian> { return(ArrayFromVectorOp.ArrayAverageConditional <GaussianList>(array, vector, to_vector, result)); }