Search Results for

    Show / Hide Table of Contents

    Class DirichletOp

    Provides outgoing messages for DirichletFromMeanAndTotalCount(Vector, Double), given random arguments to the function.

    Inheritance
    Object
    DirichletOp
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic.Factors
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    [FactorMethod(typeof(Factor), "DirichletFromMeanAndTotalCount", new Type[]{})]
    [Quality(QualityBand.Preview)]
    public static class DirichletOp

    Fields

    damping

    How much damping to use to prevent improper messages. Higher values result in more damping.

    Declaration
    public static double damping
    Field Value
    Type Description
    Double

    Methods

    AverageLogFactor(Dirichlet, Dirichlet, Gamma)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Dirichlet prob, Dirichlet mean, Gamma totalCount)
    Parameters
    Type Name Description
    Dirichlet prob

    Incoming message from prob.

    Dirichlet mean

    Incoming message from mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is sum_(prob,mean,totalCount) p(prob,mean,totalCount) log(factor(prob,mean,totalCount)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    AverageLogFactor(Dirichlet, Vector, Gamma)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Dirichlet prob, Vector mean, Gamma totalCount)
    Parameters
    Type Name Description
    Dirichlet prob

    Incoming message from prob.

    Vector mean

    Constant value for mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is sum_(prob,totalCount) p(prob,totalCount) log(factor(prob,mean,totalCount)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    AverageLogFactor(Vector, Dirichlet, Gamma)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Vector prob, Dirichlet mean, Gamma totalCount)
    Parameters
    Type Name Description
    Vector prob

    Constant value for prob.

    Dirichlet mean

    Incoming message from mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is sum_(mean,totalCount) p(mean,totalCount) log(factor(prob,mean,totalCount)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    AverageLogFactor(Vector, Vector, Gamma)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Vector prob, Vector mean, Gamma totalCount)
    Parameters
    Type Name Description
    Vector prob

    Constant value for prob.

    Vector mean

    Constant value for mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is sum_(totalCount) p(totalCount) log(factor(prob,mean,totalCount)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    AverageLogFactor(Vector, Vector, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Vector prob, Vector mean, double totalCount)
    Parameters
    Type Name Description
    Vector prob

    Constant value for prob.

    Vector mean

    Constant value for mean.

    Double totalCount

    Constant value for totalCount.

    Returns
    Type Description
    Double

    Average of the factor's log-value across the given argument distributions.

    Remarks

    The formula for the result is log(factor(prob,mean,totalCount)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    EvidenceMessageExpectations(Dirichlet, Gamma)

    Perform the quadrature required for the VMP evidence message

    Declaration
    public static Vector EvidenceMessageExpectations(Dirichlet meanQ, Gamma totalCountQ)
    Parameters
    Type Name Description
    Dirichlet meanQ

    Incoming message from m='mean'.

    Gamma totalCountQ

    Incoming message from s='totalCount'.

    Returns
    Type Description
    Vector

    Vector of E[ LogGamma(s*m_k)].

    Remarks

    The quadrature over 'totalCount' (which is Gamma-distributed) is peformed by a change of variable x=log(s) followed by Gauss-Hermite quadrature. The quadrature over m is performed using Gauss-Legendre.

    LogAverageFactor(Dirichlet, Dirichlet, Gamma)

    Evidence message for EP.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static double LogAverageFactor(Dirichlet prob, Dirichlet mean, Gamma totalCount)
    Parameters
    Type Name Description
    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(prob,mean,totalCount) p(prob,mean,totalCount) factor(prob,mean,totalCount)).

    Exceptions
    Type Condition
    ImproperMessageException

    prob is not a proper distribution.

    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    totalCount is not a proper distribution.

    LogAverageFactor(Dirichlet, Dirichlet, Double)

    Evidence message for EP.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static double LogAverageFactor(Dirichlet prob, Dirichlet mean, double totalCount)
    Parameters
    Type Name Description
    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Double totalCount

    Constant value for totalCount.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(prob,mean) p(prob,mean) factor(prob,mean,totalCount)).

    Exceptions
    Type Condition
    ImproperMessageException

    prob is not a proper distribution.

    ImproperMessageException

    mean is not a proper distribution.

    LogAverageFactor(Dirichlet, Vector, Dirichlet, Double)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(Dirichlet prob, Vector mean, Dirichlet to_prob, double totalCount)
    Parameters
    Type Name Description
    Dirichlet prob

    Incoming message from prob.

    Vector mean

    Constant value for mean.

    Dirichlet to_prob

    Previous outgoing message to prob.

    Double totalCount

    Constant value for totalCount.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(prob) p(prob) factor(prob,mean,totalCount)).

    LogAverageFactor(Dirichlet, Vector, Gamma)

    Evidence message for EP.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static double LogAverageFactor(Dirichlet prob, Vector mean, Gamma totalCount)
    Parameters
    Type Name Description
    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Vector mean

    Constant value for mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(prob,totalCount) p(prob,totalCount) factor(prob,mean,totalCount)).

    Exceptions
    Type Condition
    ImproperMessageException

    prob is not a proper distribution.

    ImproperMessageException

    totalCount is not a proper distribution.

    LogAverageFactor(Vector, Dirichlet, Gamma)

    Evidence message for EP.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static double LogAverageFactor(Vector prob, Dirichlet mean, Gamma totalCount)
    Parameters
    Type Name Description
    Vector prob

    Constant value for prob.

    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(mean,totalCount) p(mean,totalCount) factor(prob,mean,totalCount)).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    totalCount is not a proper distribution.

    LogAverageFactor(Vector, Dirichlet, Double)

    Evidence message for EP.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static double LogAverageFactor(Vector prob, Dirichlet mean, double totalCount)
    Parameters
    Type Name Description
    Vector prob

    Constant value for prob.

    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Double totalCount

    Constant value for totalCount.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(mean) p(mean) factor(prob,mean,totalCount)).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    LogAverageFactor(Vector, Vector, Gamma)

    Evidence message for EP.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static double LogAverageFactor(Vector prob, Vector mean, Gamma totalCount)
    Parameters
    Type Name Description
    Vector prob

    Constant value for prob.

    Vector mean

    Constant value for mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(sum_(totalCount) p(totalCount) factor(prob,mean,totalCount)).

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    LogAverageFactor(Vector, Vector, Double)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(Vector prob, Vector mean, double totalCount)
    Parameters
    Type Name Description
    Vector prob

    Constant value for prob.

    Vector mean

    Constant value for mean.

    Double totalCount

    Constant value for totalCount.

    Returns
    Type Description
    Double

    Logarithm of the factor's average value across the given argument distributions.

    Remarks

    The formula for the result is log(factor(prob,mean,totalCount)).

    LogEvidenceRatio(Vector, Vector, Double)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Vector prob, Vector mean, double totalCount)
    Parameters
    Type Name Description
    Vector prob

    Constant value for prob.

    Vector mean

    Constant value for mean.

    Double totalCount

    Constant value for totalCount.

    Returns
    Type Description
    Double

    Logarithm of the factor's contribution the EP model evidence.

    Remarks

    The formula for the result is log(factor(prob,mean,totalCount)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    MeanAverageConditional(Dirichlet, Gamma, Dirichlet, Dirichlet)

    EP message to mean.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Dirichlet MeanAverageConditional(Dirichlet mean, Gamma totalCount, Dirichlet prob, Dirichlet result)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

    The outgoing message is a distribution matching the moments of mean as the random arguments are varied. The formula is proj[p(mean) sum_(totalCount,prob) p(totalCount,prob) factor(prob,mean,totalCount)]/p(mean).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    totalCount is not a proper distribution.

    ImproperMessageException

    prob is not a proper distribution.

    MeanAverageConditional(Dirichlet, Gamma, Vector, Dirichlet)

    EP message to mean.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Dirichlet MeanAverageConditional(Dirichlet mean, Gamma totalCount, Vector prob, Dirichlet result)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Vector prob

    Constant value for prob.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

    The outgoing message is a distribution matching the moments of mean as the random arguments are varied. The formula is proj[p(mean) sum_(totalCount) p(totalCount) factor(prob,mean,totalCount)]/p(mean).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    totalCount is not a proper distribution.

    MeanAverageConditional(Dirichlet, Double, Dirichlet, Dirichlet)

    EP message to mean.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Dirichlet MeanAverageConditional(Dirichlet mean, double totalCount, Dirichlet prob, Dirichlet result)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Double totalCount

    Constant value for totalCount.

    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

    The outgoing message is a distribution matching the moments of mean as the random arguments are varied. The formula is proj[p(mean) sum_(prob) p(prob) factor(prob,mean,totalCount)]/p(mean).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    prob is not a proper distribution.

    MeanAverageConditional(Dirichlet, Double, Vector, Dirichlet)

    EP message to mean.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Dirichlet MeanAverageConditional(Dirichlet mean, double totalCount, Vector prob, Dirichlet result)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Double totalCount

    Constant value for totalCount.

    Vector prob

    Constant value for prob.

    Dirichlet result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Dirichlet

    result

    Remarks

    The outgoing message is the factor viewed as a function of mean conditioned on the given values.

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    MeanAverageLogarithm(Dirichlet, Gamma, Dirichlet, Dirichlet)

    VMP message to mean.

    Declaration
    public static Dirichlet MeanAverageLogarithm(Dirichlet mean, Gamma totalCount, Dirichlet prob, Dirichlet to_mean)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Dirichlet to_mean

    Previous outgoing message to mean.

    Returns
    Type Description
    Dirichlet

    The outgoing VMP message to the mean argument.

    Remarks

    The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except mean. The formula is exp(sum_(totalCount,prob) p(totalCount,prob) log(factor(prob,mean,totalCount))).

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    ImproperMessageException

    prob is not a proper distribution.

    MeanMessageExpectations(Vector, Gamma, out Double[], out Double[], out Double[])

    Perform the quadrature required for the Nonconjugate VMP message to 'mean'

    Declaration
    public static void MeanMessageExpectations(Vector meanQPseudoCount, Gamma totalCountQ, out double[] EELogGamma, out double[] EELogMLogGamma, out double[] EELogOneMinusMLogGamma)
    Parameters
    Type Name Description
    Vector meanQPseudoCount

    Incoming message from 'mean'.

    Gamma totalCountQ

    Incoming message from 'totalCount'.

    Double[] EELogGamma

    Array to be filled with E[LogGamma(s*m_k)].

    Double[] EELogMLogGamma

    Array to be filled with E[Log(m_k)LogGamma(sm_k)].

    Double[] EELogOneMinusMLogGamma

    Array to be filled with E[Log(1-m_k)LogGamma(sm_k)].

    Remarks

    All three arrays are calculated simultaneously for efficiency. The quadrature over 'totalCount' (which is Gamma-distributed) is performed by a change of variable x=log(s) followed by Gauss-Hermite quadrature. The quadrature over m is performed using Gauss-Legendre.

    ProbAverageConditional(Dirichlet, Gamma)

    EP message to prob.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Dirichlet ProbAverageConditional(Dirichlet mean, Gamma totalCount)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Dirichlet

    The outgoing EP message to the prob argument.

    Remarks

    The outgoing message is a distribution matching the moments of prob as the random arguments are varied. The formula is proj[p(prob) sum_(mean,totalCount) p(mean,totalCount) factor(prob,mean,totalCount)]/p(prob).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    totalCount is not a proper distribution.

    ProbAverageConditional(Dirichlet, Double)

    EP message to prob.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Dirichlet ProbAverageConditional(Dirichlet mean, double totalCount)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Double totalCount

    Constant value for totalCount.

    Returns
    Type Description
    Dirichlet

    The outgoing EP message to the prob argument.

    Remarks

    The outgoing message is a distribution matching the moments of prob as the random arguments are varied. The formula is proj[p(prob) sum_(mean) p(mean) factor(prob,mean,totalCount)]/p(prob).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ProbAverageConditional(Vector, Gamma)

    EP message to prob.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Dirichlet ProbAverageConditional(Vector mean, Gamma totalCount)
    Parameters
    Type Name Description
    Vector mean

    Constant value for mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Returns
    Type Description
    Dirichlet

    The outgoing EP message to the prob argument.

    Remarks

    The outgoing message is a distribution matching the moments of prob as the random arguments are varied. The formula is proj[p(prob) sum_(totalCount) p(totalCount) factor(prob,mean,totalCount)]/p(prob).

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    ProbAverageConditional(Vector, Double)

    EP message to prob.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Dirichlet ProbAverageConditional(Vector mean, double totalCount)
    Parameters
    Type Name Description
    Vector mean

    Constant value for mean.

    Double totalCount

    Constant value for totalCount.

    Returns
    Type Description
    Dirichlet

    The outgoing EP message to the prob argument.

    Remarks

    The outgoing message is the factor viewed as a function of prob conditioned on the given values.

    ProbAverageConditional(Vector, Double, Dirichlet)

    Declaration
    public static Dirichlet ProbAverageConditional(Vector mean, double totalCount, Dirichlet result)
    Parameters
    Type Name Description
    Vector mean
    Double totalCount
    Dirichlet result
    Returns
    Type Description
    Dirichlet

    ProbAverageLogarithm(Dirichlet, Gamma, Dirichlet)

    Declaration
    public static Dirichlet ProbAverageLogarithm(Dirichlet mean, Gamma totalCount, Dirichlet result)
    Parameters
    Type Name Description
    Dirichlet mean
    Gamma totalCount
    Dirichlet result
    Returns
    Type Description
    Dirichlet

    ProbAverageLogarithm(Dirichlet, Double, Dirichlet)

    Declaration
    public static Dirichlet ProbAverageLogarithm(Dirichlet mean, double totalCount, Dirichlet result)
    Parameters
    Type Name Description
    Dirichlet mean
    Double totalCount
    Dirichlet result
    Returns
    Type Description
    Dirichlet

    ProbAverageLogarithm(Vector, Gamma, Dirichlet)

    Declaration
    public static Dirichlet ProbAverageLogarithm(Vector mean, Gamma totalCount, Dirichlet result)
    Parameters
    Type Name Description
    Vector mean
    Gamma totalCount
    Dirichlet result
    Returns
    Type Description
    Dirichlet

    ProbAverageLogarithm(Vector, Double, Dirichlet)

    Declaration
    public static Dirichlet ProbAverageLogarithm(Vector mean, double totalCount, Dirichlet result)
    Parameters
    Type Name Description
    Vector mean
    Double totalCount
    Dirichlet result
    Returns
    Type Description
    Dirichlet

    TotalCountAverageConditional(Dirichlet, Gamma, Dirichlet, Gamma)

    EP message to totalCount.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Gamma TotalCountAverageConditional(Dirichlet mean, Gamma totalCount, Dirichlet prob, Gamma result)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Gamma

    result

    Remarks

    The outgoing message is a distribution matching the moments of totalCount as the random arguments are varied. The formula is proj[p(totalCount) sum_(mean,prob) p(mean,prob) factor(prob,mean,totalCount)]/p(totalCount).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    totalCount is not a proper distribution.

    ImproperMessageException

    prob is not a proper distribution.

    TotalCountAverageConditional(Dirichlet, Gamma, Vector, Gamma)

    EP message to totalCount.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Gamma TotalCountAverageConditional(Dirichlet mean, Gamma totalCount, Vector prob, Gamma result)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Vector prob

    Constant value for prob.

    Gamma result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Gamma

    result

    Remarks

    The outgoing message is a distribution matching the moments of totalCount as the random arguments are varied. The formula is proj[p(totalCount) sum_(mean) p(mean) factor(prob,mean,totalCount)]/p(totalCount).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    totalCount is not a proper distribution.

    TotalCountAverageConditional(Vector, Gamma, Dirichlet, Gamma)

    EP message to totalCount.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Gamma TotalCountAverageConditional(Vector mean, Gamma totalCount, Dirichlet prob, Gamma result)
    Parameters
    Type Name Description
    Vector mean

    Constant value for mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Gamma

    result

    Remarks

    The outgoing message is a distribution matching the moments of totalCount as the random arguments are varied. The formula is proj[p(totalCount) sum_(prob) p(prob) factor(prob,mean,totalCount)]/p(totalCount).

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    ImproperMessageException

    prob is not a proper distribution.

    TotalCountAverageConditional(Vector, Gamma, Vector, Gamma)

    EP message to totalCount.

    Declaration
    [NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
    public static Gamma TotalCountAverageConditional(Vector mean, Gamma totalCount, Vector prob, Gamma result)
    Parameters
    Type Name Description
    Vector mean

    Constant value for mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Vector prob

    Constant value for prob.

    Gamma result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Gamma

    result

    Remarks

    The outgoing message is the factor viewed as a function of totalCount conditioned on the given values.

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    TotalCountAverageLogarithm(Dirichlet, Gamma, Dirichlet, Gamma)

    VMP message to totalCount.

    Declaration
    public static Gamma TotalCountAverageLogarithm(Dirichlet mean, Gamma totalCount, Dirichlet prob, Gamma to_totalCount)
    Parameters
    Type Name Description
    Dirichlet mean

    Incoming message from mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma to_totalCount

    Previous outgoing message to totalCount.

    Returns
    Type Description
    Gamma

    The outgoing VMP message to the totalCount argument.

    Remarks

    The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except totalCount. The formula is exp(sum_(mean,prob) p(mean,prob) log(factor(prob,mean,totalCount))).

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    ImproperMessageException

    prob is not a proper distribution.

    TotalCountAverageLogarithm(Vector, Gamma, Dirichlet, Gamma)

    VMP message to totalCount.

    Declaration
    public static Gamma TotalCountAverageLogarithm(Vector mean, Gamma totalCount, Dirichlet prob, Gamma to_totalCount)
    Parameters
    Type Name Description
    Vector mean

    Constant value for mean.

    Gamma totalCount

    Incoming message from totalCount. Must be a proper distribution. If uniform, the result will be uniform.

    Dirichlet prob

    Incoming message from prob. Must be a proper distribution. If any element is uniform, the result will be uniform.

    Gamma to_totalCount

    Previous outgoing message to totalCount.

    Returns
    Type Description
    Gamma

    The outgoing VMP message to the totalCount argument.

    Remarks

    The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except totalCount. The formula is exp(sum_(prob) p(prob) log(factor(prob,mean,totalCount))).

    Exceptions
    Type Condition
    ImproperMessageException

    totalCount is not a proper distribution.

    ImproperMessageException

    prob is not a proper distribution.

    TotalCountMessageExpectations(Vector, Gamma, out Double[], out Double[], out Double[])

    Perform the quadrature required for the Nonconjugate VMP message to 'totalCount'

    Declaration
    public static void TotalCountMessageExpectations(Vector meanQPseudoCount, Gamma totalCountQ, out double[] EELogGamma, out double[] EELogSLogGamma, out double[] EEMSDigamma)
    Parameters
    Type Name Description
    Vector meanQPseudoCount

    Incoming message from 'mean'.

    Gamma totalCountQ

    Incoming message from 'totalCount'.

    Double[] EELogGamma

    Array to be filled with E[LogGamma(s*m_k)].

    Double[] EELogSLogGamma

    Array to be filled with E[Log(s)LogGamma(sm_k)].

    Double[] EEMSDigamma

    Array to be filled with E[sm_kDigamma(s*m_k)].

    Remarks

    All three arrays are calculated simultaneously for efficiency. The quadrature over 'totalCount' (which is Gamma-distributed) is peformed by a change of variable x=log(s) followed by Gauss-Hermite quadrature. The quadrature over m is performed using Gauss-Legendre.

    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.