Search Results for

    Show / Hide Table of Contents

    Class DiscreteUniform

    Provides outgoing messages for DiscreteUniform(Int32), given random arguments to the function.

    Inheritance
    Object
    DiscreteUniform
    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), "DiscreteUniform", new Type[]{})]
    [Quality(QualityBand.Mature)]
    public static class DiscreteUniform
    Remarks

    Factor is f(sample, size) = 1(sample < size)/size

    Methods

    AverageLogFactor(Discrete, Discrete)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Discrete sample, Discrete size)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Discrete size

    Incoming message from size.

    Returns
    Type Description
    Double

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

    Remarks

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

    AverageLogFactor(Discrete, Int32)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Discrete sample, int size)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Int32 size

    Constant value for size.

    Returns
    Type Description
    Double

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

    Remarks

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

    AverageLogFactor(Int32, Discrete)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(int sample, Discrete size)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Discrete size

    Incoming message from size.

    Returns
    Type Description
    Double

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

    Remarks

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

    AverageLogFactor(Int32, Int32)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(int sample, int size)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Int32 size

    Constant value for size.

    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(sample,size)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    LogAverageFactor(Discrete, Discrete)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(Discrete sample, Discrete to_sample)
    Parameters
    Type Name Description
    Discrete sample

    Incoming message from sample.

    Discrete to_sample

    Outgoing message to sample.

    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_(sample) p(sample) factor(sample,size)).

    LogAverageFactor(Int32, Discrete)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(int sample, Discrete size)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Discrete size

    Incoming message from size.

    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_(size) p(size) factor(sample,size)).

    LogAverageFactor(Int32, Int32)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(int sample, int size)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Int32 size

    Constant value for size.

    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(sample,size)).

    LogEvidenceRatio(Discrete, Discrete)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Discrete sample, Discrete size)
    Parameters
    Type Name Description
    Discrete sample

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

    Discrete size

    Incoming message from size.

    Returns
    Type Description
    Double

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

    Remarks

    The formula for the result is log(sum_(sample,size) p(sample,size) factor(sample,size) / sum_sample p(sample) messageTo(sample)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    LogEvidenceRatio(Discrete, Int32)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Discrete sample, int size)
    Parameters
    Type Name Description
    Discrete sample

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

    Int32 size

    Constant value for size.

    Returns
    Type Description
    Double

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

    Remarks

    The formula for the result is log(sum_(sample) p(sample) factor(sample,size) / sum_sample p(sample) messageTo(sample)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    LogEvidenceRatio(Int32, Discrete)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(int sample, Discrete size)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Discrete size

    Incoming message from size.

    Returns
    Type Description
    Double

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

    Remarks

    The formula for the result is log(sum_(size) p(size) factor(sample,size)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    LogEvidenceRatio(Int32, Int32)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(int sample, int size)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Int32 size

    Constant value for size.

    Returns
    Type Description
    Double

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

    Remarks

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

    SampleAverageConditional(Discrete, Discrete)

    EP message to sample.

    Declaration
    public static Discrete SampleAverageConditional(Discrete size, Discrete result)
    Parameters
    Type Name Description
    Discrete size

    Incoming message from size.

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

    SampleAverageConditional(Int32, Discrete)

    EP message to sample.

    Declaration
    public static Discrete SampleAverageConditional(int size, Discrete result)
    Parameters
    Type Name Description
    Int32 size

    Constant value for size.

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

    SampleAverageConditionalInit(Discrete)

    Declaration
    public static Discrete SampleAverageConditionalInit(Discrete size)
    Parameters
    Type Name Description
    Discrete size

    Incoming message from size.

    Returns
    Type Description
    Discrete
    Remarks

    SampleAverageConditionalInit(Int32)

    Declaration
    public static Discrete SampleAverageConditionalInit(int size)
    Parameters
    Type Name Description
    Int32 size

    Constant value for size.

    Returns
    Type Description
    Discrete
    Remarks

    SampleAverageLogarithm(Discrete, Discrete)

    VMP message to sample.

    Declaration
    public static Discrete SampleAverageLogarithm(Discrete size, Discrete result)
    Parameters
    Type Name Description
    Discrete size

    Incoming message from size.

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

    SampleAverageLogarithm(Int32, Discrete)

    VMP message to sample.

    Declaration
    public static Discrete SampleAverageLogarithm(int size, Discrete result)
    Parameters
    Type Name Description
    Int32 size

    Constant value for size.

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

    SampleAverageLogarithmInit(Discrete)

    Declaration
    public static Discrete SampleAverageLogarithmInit(Discrete size)
    Parameters
    Type Name Description
    Discrete size

    Incoming message from size.

    Returns
    Type Description
    Discrete
    Remarks

    SampleAverageLogarithmInit(Int32)

    Declaration
    public static Discrete SampleAverageLogarithmInit(int size)
    Parameters
    Type Name Description
    Int32 size

    Constant value for size.

    Returns
    Type Description
    Discrete
    Remarks

    SizeAverageConditional(Discrete, Discrete)

    EP message to size.

    Declaration
    public static Discrete SizeAverageConditional(Discrete sample, Discrete result)
    Parameters
    Type Name Description
    Discrete sample

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

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    SizeAverageConditional(Int32, Discrete)

    EP message to size.

    Declaration
    public static Discrete SizeAverageConditional(int sample, Discrete result)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

    SizeAverageLogarithm(Discrete, Discrete)

    VMP message to size.

    Declaration
    public static Discrete SizeAverageLogarithm(Discrete sample, Discrete result)
    Parameters
    Type Name Description
    Discrete sample

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

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    SizeAverageLogarithm(Int32, Discrete)

    VMP message to size.

    Declaration
    public static Discrete SizeAverageLogarithm(int sample, Discrete result)
    Parameters
    Type Name Description
    Int32 sample

    Constant value for sample.

    Discrete result

    Modified to contain the outgoing message.

    Returns
    Type Description
    Discrete

    result

    Remarks

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

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