Search Results for

    Show / Hide Table of Contents

    Class BernoulliFromBetaOp

    Provides outgoing messages for the following factors:

    • Sample(Double)
    • Bernoulli(Double)
    , given random arguments to the function.

    Inheritance
    Object
    BernoulliFromBetaOp
    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(Bernoulli), "Sample", new Type[]{typeof(double)})]
    [FactorMethod(new string[]{"Sample", "ProbTrue"}, typeof(Factor), "Bernoulli", new Type[]{})]
    [Quality(QualityBand.Mature)]
    public static class BernoulliFromBetaOp

    Methods

    AverageLogFactor(Bernoulli, Beta)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Bernoulli sample, Beta probTrue)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    Beta probTrue

    Incoming message from probTrue. 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_(sample,probTrue) p(sample,probTrue) log(factor(sample,probTrue)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    probTrue is not a proper distribution.

    AverageLogFactor(Bernoulli, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Bernoulli sample, double probTrue)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    Double probTrue

    Constant value for probTrue.

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

    AverageLogFactor(Boolean, Beta)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(bool sample, Beta probTrue)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Beta probTrue

    Incoming message from probTrue. 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_(probTrue) p(probTrue) log(factor(sample,probTrue)). Adding up these values across all factors and variables gives the log-evidence estimate for VMP.

    Exceptions
    Type Condition
    ImproperMessageException

    probTrue is not a proper distribution.

    AverageLogFactor(Boolean, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(bool sample, double probTrue)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Double probTrue

    Constant value for probTrue.

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

    LogAverageFactor(Bernoulli, Bernoulli)

    Evidence message for EP.

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

    Incoming message from sample.

    Bernoulli 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,probTrue)).

    LogAverageFactor(Boolean, Beta)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(bool sample, Beta probTrue)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Beta probTrue

    Incoming message from probTrue.

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

    LogAverageFactor(Boolean, Double)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(bool sample, double probTrue)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Double probTrue

    Constant value for probTrue.

    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,probTrue)).

    LogEvidenceRatio(Bernoulli, Beta)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Bernoulli sample, Beta probTrue)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    Beta probTrue

    Incoming message from probTrue.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogEvidenceRatio(Bernoulli, Double)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Bernoulli sample, double probTrue)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    Double probTrue

    Constant value for probTrue.

    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,probTrue) / sum_sample p(sample) messageTo(sample)). Adding up these values across all factors and variables gives the log-evidence estimate for EP.

    LogEvidenceRatio(Boolean, Beta)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(bool sample, Beta probTrue)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Beta probTrue

    Incoming message from probTrue.

    Returns
    Type Description
    Double

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

    Remarks

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

    LogEvidenceRatio(Boolean, Double)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(bool sample, double probTrue)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Double probTrue

    Constant value for probTrue.

    Returns
    Type Description
    Double

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

    Remarks

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

    ProbTrueAverageConditional(Bernoulli, Beta)

    EP message to probTrue.

    Declaration
    public static Beta ProbTrueAverageConditional(Bernoulli sample, Beta probTrue)
    Parameters
    Type Name Description
    Bernoulli sample

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

    Beta probTrue

    Incoming message from probTrue.

    Returns
    Type Description
    Beta

    The outgoing EP message to the probTrue argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ProbTrueAverageConditional(Bernoulli, Double)

    Declaration
    public static Beta ProbTrueAverageConditional(Bernoulli sample, double probTrue)
    Parameters
    Type Name Description
    Bernoulli sample
    Double probTrue
    Returns
    Type Description
    Beta

    ProbTrueAverageConditional(Boolean)

    EP message to probTrue.

    Declaration
    public static Beta ProbTrueAverageConditional(bool sample)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Returns
    Type Description
    Beta

    The outgoing EP message to the probTrue argument.

    Remarks

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

    ProbTrueAverageLogarithm(Bernoulli)

    VMP message to probTrue.

    Declaration
    public static Beta ProbTrueAverageLogarithm(Bernoulli sample)
    Parameters
    Type Name Description
    Bernoulli sample

    Incoming message from sample.

    Returns
    Type Description
    Beta

    The outgoing VMP message to the probTrue argument.

    Remarks

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

    ProbTrueAverageLogarithm(Boolean)

    VMP message to probTrue.

    Declaration
    public static Beta ProbTrueAverageLogarithm(bool sample)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Returns
    Type Description
    Beta

    The outgoing VMP message to the probTrue argument.

    Remarks

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

    ProbTrueConditional(Boolean)

    Gibbs message to probTrue.

    Declaration
    public static Beta ProbTrueConditional(bool sample)
    Parameters
    Type Name Description
    Boolean sample

    Constant value for sample.

    Returns
    Type Description
    Beta

    The outgoing Gibbs message to the probTrue argument.

    Remarks

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

    SampleAverageConditional(Beta)

    EP message to sample.

    Declaration
    public static Bernoulli SampleAverageConditional(Beta probTrue)
    Parameters
    Type Name Description
    Beta probTrue

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

    Returns
    Type Description
    Bernoulli

    The outgoing EP message to the sample argument.

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

    Exceptions
    Type Condition
    ImproperMessageException

    probTrue is not a proper distribution.

    SampleAverageConditional(Double)

    EP message to sample.

    Declaration
    public static Bernoulli SampleAverageConditional(double probTrue)
    Parameters
    Type Name Description
    Double probTrue

    Constant value for probTrue.

    Returns
    Type Description
    Bernoulli

    The outgoing EP message to the sample argument.

    Remarks

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

    SampleAverageLogarithm(Beta)

    VMP message to sample.

    Declaration
    public static Bernoulli SampleAverageLogarithm(Beta probTrue)
    Parameters
    Type Name Description
    Beta probTrue

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

    Returns
    Type Description
    Bernoulli

    The outgoing VMP message to the sample argument.

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

    Exceptions
    Type Condition
    ImproperMessageException

    probTrue is not a proper distribution.

    SampleAverageLogarithm(Double)

    VMP message to sample.

    Declaration
    public static Bernoulli SampleAverageLogarithm(double probTrue)
    Parameters
    Type Name Description
    Double probTrue

    Constant value for probTrue.

    Returns
    Type Description
    Bernoulli

    The outgoing VMP message to the sample argument.

    Remarks

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

    SampleConditional(Double)

    Gibbs message to sample.

    Declaration
    public static Bernoulli SampleConditional(double probTrue)
    Parameters
    Type Name Description
    Double probTrue

    Constant value for probTrue.

    Returns
    Type Description
    Bernoulli

    The outgoing Gibbs message to the sample argument.

    Remarks

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

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