Search Results for

    Show / Hide Table of Contents

    Class GaussianOp

    Provides outgoing messages for the following factors:

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

    Inheritance
    Object
    GaussianOpBase
    GaussianOp
    Inherited Members
    GaussianOpBase.SampleAverageConditional(Double, Double)
    GaussianOpBase.MeanAverageConditional(Double, Double)
    GaussianOpBase.PrecisionAverageConditional(Double, Double)
    GaussianOpBase.SampleAverageConditional(Gaussian, Double)
    GaussianOpBase.MeanAverageConditional(Gaussian, Double)
    GaussianOpBase.LogAverageFactor(Double, Double, Double)
    GaussianOpBase.LogAverageFactor(Gaussian, Gaussian, Double)
    GaussianOpBase.LogAverageFactor(Gaussian, Double, Double)
    GaussianOpBase.LogAverageFactor(Double, Gaussian, Double)
    GaussianOpBase.LogAverageFactor(Double, Double, Gamma)
    GaussianOpBase.TPdfLn(Double, Double, Double)
    GaussianOpBase.LogEvidenceRatio(Double, Double, Double)
    GaussianOpBase.LogEvidenceRatio(Gaussian, Gaussian, Double)
    GaussianOpBase.LogEvidenceRatio(Gaussian, Double, Double)
    GaussianOpBase.LogEvidenceRatio(Double, Gaussian, Double)
    GaussianOpBase.LogEvidenceRatio(Double, Double, Gamma)
    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(Gaussian), "Sample", new Type[]{typeof(double), typeof(double)}, Default = true)]
    [FactorMethod(new string[]{"sample", "mean", "precision"}, typeof(Factor), "Gaussian", new Type[]{}, Default = true)]
    [Quality(QualityBand.Mature)]
    public class GaussianOp : GaussianOpBase

    Fields

    ForceProper

    Static flag to force a proper distribution

    Declaration
    public static bool ForceProper
    Field Value
    Type Description
    Boolean

    modified

    Declaration
    public static bool modified
    Field Value
    Type Description
    Boolean

    QuadratureNodeCount

    Number of quadrature nodes to use for computing the messages. Reduce this number to save time in exchange for less accuracy.

    Declaration
    public static int QuadratureNodeCount
    Field Value
    Type Description
    Int32

    Methods

    AverageLogFactor(Gaussian, Gaussian, Gamma)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Gaussian sample, Gaussian mean, Gamma precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Gaussian mean

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

    Gamma precision

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    AverageLogFactor(Gaussian, Gaussian, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Gaussian sample, Gaussian mean, double precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Gaussian mean

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

    Double precision

    Constant value for precision.

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    mean is not a proper distribution.

    AverageLogFactor(Gaussian, Double, Gamma)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Gaussian sample, double mean, Gamma precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Double mean

    Constant value for mean.

    Gamma precision

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    AverageLogFactor(Gaussian, Double, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(Gaussian sample, double mean, double precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Double mean

    Constant value for mean.

    Double precision

    Constant value for precision.

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    AverageLogFactor(Double, Gaussian, Gamma)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(double sample, Gaussian mean, Gamma precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Gaussian mean

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

    Gamma precision

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

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    AverageLogFactor(Double, Gaussian, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(double sample, Gaussian mean, double precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Gaussian mean

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

    Double precision

    Constant value for precision.

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

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    AverageLogFactor(Double, Double, Gamma)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(double sample, double mean, Gamma precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Double mean

    Constant value for mean.

    Gamma precision

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

    Exceptions
    Type Condition
    ImproperMessageException

    precision is not a proper distribution.

    AverageLogFactor(Double, Double, Double)

    Evidence message for VMP.

    Declaration
    public static double AverageLogFactor(double sample, double mean, double precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Double mean

    Constant value for mean.

    Double precision

    Constant value for precision.

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

    GammaFromAlphaBeta(Gamma, Double, Double, Boolean)

    Gamma message computed directly from prior and expected derivatives of factor

    Declaration
    public static Gamma GammaFromAlphaBeta(Gamma prior, double alpha, double beta, bool forceProper)
    Parameters
    Type Name Description
    Gamma prior
    Double alpha

    Exf'/Ef = -b dlogZ/db

    Double beta

    (Exf' + Ex^2f'')/Ef - alpha^2 = -b dalpha/db

    Boolean forceProper
    Returns
    Type Description
    Gamma

    GaussianFromAlphaBeta(Gaussian, Double, Double, Boolean)

    Compute an EP message

    Declaration
    public static Gaussian GaussianFromAlphaBeta(Gaussian prior, double alpha, double beta, bool forceProper)
    Parameters
    Type Name Description
    Gaussian prior
    Double alpha

    dlogZ/dm0

    Double beta

    ddlogZ/dm0^2

    Boolean forceProper
    Returns
    Type Description
    Gaussian

    LogAverageFactor(Gaussian, Gaussian, Gamma, Gamma)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(Gaussian sample, Gaussian mean, Gamma precision, Gamma to_precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Gaussian mean

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

    Gamma precision

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

    Gamma to_precision

    Previous outgoing message to precision.

    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,mean,precision) p(sample,mean,precision) factor(sample,mean,precision)).

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    LogAverageFactor(Gaussian, Double, Gamma, Gamma)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(Gaussian sample, double mean, Gamma precision, Gamma to_precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Double mean

    Constant value for mean.

    Gamma precision

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

    Gamma to_precision

    Previous outgoing message to precision.

    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,precision) p(sample,precision) factor(sample,mean,precision)).

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    LogAverageFactor(Double, Gaussian, Gamma, Gamma)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(double sample, Gaussian mean, Gamma precision, Gamma to_precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Gaussian mean

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

    Gamma precision

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

    Gamma to_precision

    Previous outgoing message to precision.

    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,precision) p(mean,precision) factor(sample,mean,precision)).

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    LogAverageFactor_slow(Gaussian, Gaussian, Gamma)

    Declaration
    public static double LogAverageFactor_slow(Gaussian sample, Gaussian mean, Gamma precision)
    Parameters
    Type Name Description
    Gaussian sample
    Gaussian mean
    Gamma precision
    Returns
    Type Description
    Double

    LogEvidenceRatio(Gaussian, Gaussian, Gamma, Gaussian, Gamma)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Gaussian sample, Gaussian mean, Gamma precision, Gaussian to_sample, Gamma to_precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Gaussian mean

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

    Gamma precision

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

    Gaussian to_sample

    Outgoing message to sample.

    Gamma to_precision

    Previous outgoing message to precision.

    Returns
    Type Description
    Double

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

    Remarks

    The formula for the result is log(sum_(sample,mean,precision) p(sample,mean,precision) factor(sample,mean,precision) / 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.

    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    LogEvidenceRatio(Gaussian, Double, Gamma, Gaussian, Gamma)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(Gaussian sample, double mean, Gamma precision, Gaussian to_sample, Gamma to_precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Double mean

    Constant value for mean.

    Gamma precision

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

    Gaussian to_sample

    Outgoing message to sample.

    Gamma to_precision

    Previous outgoing message to precision.

    Returns
    Type Description
    Double

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

    Remarks

    The formula for the result is log(sum_(sample,precision) p(sample,precision) factor(sample,mean,precision) / 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.

    ImproperMessageException

    precision is not a proper distribution.

    LogEvidenceRatio(Double, Gaussian, Gamma, Gamma)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(double sample, Gaussian mean, Gamma precision, Gamma to_precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Gaussian mean

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

    Gamma precision

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

    Gamma to_precision

    Previous outgoing message to precision.

    Returns
    Type Description
    Double

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

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    LogFactorValue(Double, Double, Double)

    Evidence message for Gibbs.

    Declaration
    public static double LogFactorValue(double sample, double mean, double precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Double mean

    Constant value for mean.

    Double precision

    Constant value for precision.

    Returns
    Type Description
    Double

    Logarithm of the factor's value at the given arguments.

    Remarks

    MeanAverageConditional(Gaussian, Gaussian, Gamma, Gamma)

    EP message to mean.

    Declaration
    public static Gaussian MeanAverageConditional(Gaussian sample, Gaussian mean, Gamma precision, Gamma to_precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Gaussian mean

    Incoming message from mean.

    Gamma precision

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

    Gamma to_precision

    Previous outgoing message to precision.

    Returns
    Type Description
    Gaussian

    The outgoing EP message to the mean argument.

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    MeanAverageConditional(Double, Gaussian, Gamma, Gamma)

    EP message to mean.

    Declaration
    public static Gaussian MeanAverageConditional(double sample, Gaussian mean, Gamma precision, Gamma to_precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Gaussian mean

    Incoming message from mean.

    Gamma precision

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

    Gamma to_precision

    Previous outgoing message to precision.

    Returns
    Type Description
    Gaussian

    The outgoing EP message to the mean argument.

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

    Exceptions
    Type Condition
    ImproperMessageException

    precision is not a proper distribution.

    MeanAverageConditional(Double, Double, TruncatedGaussian)

    EP message to mean.

    Declaration
    public static TruncatedGaussian MeanAverageConditional(double sample, double precision, TruncatedGaussian result)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Double precision

    Constant value for precision.

    TruncatedGaussian result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TruncatedGaussian

    result

    Remarks

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

    MeanAverageConditional_slow(Gaussian, Gaussian, Gamma)

    Declaration
    public static Gaussian MeanAverageConditional_slow(Gaussian sample, Gaussian mean, Gamma precision)
    Parameters
    Type Name Description
    Gaussian sample
    Gaussian mean
    Gamma precision
    Returns
    Type Description
    Gaussian

    MeanAverageLogarithm(Gaussian, Gamma)

    VMP message to mean.

    Declaration
    public static Gaussian MeanAverageLogarithm(Gaussian sample, Gamma precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Gamma precision

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

    Returns
    Type Description
    Gaussian

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    MeanAverageLogarithm(Gaussian, Double)

    VMP message to mean.

    Declaration
    public static Gaussian MeanAverageLogarithm(Gaussian sample, double precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Double precision

    Constant value for precision.

    Returns
    Type Description
    Gaussian

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    MeanAverageLogarithm(Double, Gamma)

    VMP message to mean.

    Declaration
    public static Gaussian MeanAverageLogarithm(double sample, Gamma precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Gamma precision

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

    Returns
    Type Description
    Gaussian

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

    Exceptions
    Type Condition
    ImproperMessageException

    precision is not a proper distribution.

    MeanAverageLogarithm(Double, Double)

    VMP message to mean.

    Declaration
    public static Gaussian MeanAverageLogarithm(double sample, double precision)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Double precision

    Constant value for precision.

    Returns
    Type Description
    Gaussian

    The outgoing VMP message to the mean argument.

    Remarks

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

    PrecisionAverageConditional(Gaussian, Gaussian, Gamma)

    EP message to precision.

    Declaration
    public static Gamma PrecisionAverageConditional(Gaussian sample, Gaussian mean, Gamma precision)
    Parameters
    Type Name Description
    Gaussian sample

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

    Gaussian mean

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

    Gamma precision

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

    Returns
    Type Description
    Gamma

    The outgoing EP message to the precision argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    PrecisionAverageConditional_Point(Double, Double, Double)

    Declaration
    public static Gamma PrecisionAverageConditional_Point(double ym, double yv, double precision)
    Parameters
    Type Name Description
    Double ym
    Double yv
    Double precision
    Returns
    Type Description
    Gamma

    PrecisionAverageConditional_slow(Gaussian, Gaussian, Gamma)

    Declaration
    public static Gamma PrecisionAverageConditional_slow(Gaussian sample, Gaussian mean, Gamma precision)
    Parameters
    Type Name Description
    Gaussian sample
    Gaussian mean
    Gamma precision
    Returns
    Type Description
    Gamma

    PrecisionAverageLogarithm(Gaussian, Gaussian)

    VMP message to precision.

    Declaration
    public static Gamma PrecisionAverageLogarithm(Gaussian sample, Gaussian mean)
    Parameters
    Type Name Description
    Gaussian sample

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

    Gaussian mean

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

    Returns
    Type Description
    Gamma

    The outgoing VMP message to the precision argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    ImproperMessageException

    mean is not a proper distribution.

    PrecisionAverageLogarithm(Gaussian, Double)

    VMP message to precision.

    Declaration
    public static Gamma PrecisionAverageLogarithm(Gaussian sample, double mean)
    Parameters
    Type Name Description
    Gaussian sample

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

    Double mean

    Constant value for mean.

    Returns
    Type Description
    Gamma

    The outgoing VMP message to the precision argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    sample is not a proper distribution.

    PrecisionAverageLogarithm(Double, Gaussian)

    VMP message to precision.

    Declaration
    public static Gamma PrecisionAverageLogarithm(double sample, Gaussian mean)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Gaussian mean

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

    Returns
    Type Description
    Gamma

    The outgoing VMP message to the precision argument.

    Remarks

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

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    PrecisionAverageLogarithm(Double, Double)

    VMP message to precision.

    Declaration
    public static Gamma PrecisionAverageLogarithm(double sample, double mean)
    Parameters
    Type Name Description
    Double sample

    Constant value for sample.

    Double mean

    Constant value for mean.

    Returns
    Type Description
    Gamma

    The outgoing VMP message to the precision argument.

    Remarks

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

    QuadratureNodesAndWeights(Gamma, Double[], Double[])

    Quadrature nodes for Gamma expectations

    Declaration
    public static void QuadratureNodesAndWeights(Gamma precision, double[] nodes, double[] logWeights)
    Parameters
    Type Name Description
    Gamma precision

    'precision' message

    Double[] nodes

    Place to put the nodes

    Double[] logWeights

    Place to put the log-weights

    SampleAverageConditional(Gaussian, Gaussian, Gamma, Gamma)

    EP message to sample.

    Declaration
    public static Gaussian SampleAverageConditional(Gaussian sample, Gaussian mean, Gamma precision, Gamma to_precision)
    Parameters
    Type Name Description
    Gaussian sample

    Incoming message from sample.

    Gaussian mean

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

    Gamma precision

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

    Gamma to_precision

    Previous outgoing message to precision.

    Returns
    Type Description
    Gaussian

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

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    SampleAverageConditional(Gaussian, Double, Gamma, Gamma)

    EP message to sample.

    Declaration
    public static Gaussian SampleAverageConditional(Gaussian sample, double mean, Gamma precision, Gamma to_precision)
    Parameters
    Type Name Description
    Gaussian sample

    Incoming message from sample.

    Double mean

    Constant value for mean.

    Gamma precision

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

    Gamma to_precision

    Previous outgoing message to precision.

    Returns
    Type Description
    Gaussian

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

    Exceptions
    Type Condition
    ImproperMessageException

    precision is not a proper distribution.

    SampleAverageConditional(Double, Double, TruncatedGaussian)

    EP message to sample.

    Declaration
    public static TruncatedGaussian SampleAverageConditional(double mean, double precision, TruncatedGaussian result)
    Parameters
    Type Name Description
    Double mean

    Constant value for mean.

    Double precision

    Constant value for precision.

    TruncatedGaussian result

    Modified to contain the outgoing message.

    Returns
    Type Description
    TruncatedGaussian

    result

    Remarks

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

    SampleAverageConditional_slow(Gaussian, Gaussian, Gamma)

    Declaration
    public static Gaussian SampleAverageConditional_slow(Gaussian sample, Gaussian mean, Gamma precision)
    Parameters
    Type Name Description
    Gaussian sample
    Gaussian mean
    Gamma precision
    Returns
    Type Description
    Gaussian

    SampleAverageConditionalInit()

    Declaration
    public static Gaussian SampleAverageConditionalInit()
    Returns
    Type Description
    Gaussian
    Remarks

    SampleAverageLogarithm(Gaussian, Gamma)

    VMP message to sample.

    Declaration
    public static Gaussian SampleAverageLogarithm(Gaussian mean, Gamma precision)
    Parameters
    Type Name Description
    Gaussian mean

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

    Gamma precision

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

    Returns
    Type Description
    Gaussian

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

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    ImproperMessageException

    precision is not a proper distribution.

    SampleAverageLogarithm(Gaussian, Double)

    VMP message to sample.

    Declaration
    public static Gaussian SampleAverageLogarithm(Gaussian mean, double precision)
    Parameters
    Type Name Description
    Gaussian mean

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

    Double precision

    Constant value for precision.

    Returns
    Type Description
    Gaussian

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

    Exceptions
    Type Condition
    ImproperMessageException

    mean is not a proper distribution.

    SampleAverageLogarithm(Double, Gamma)

    VMP message to sample.

    Declaration
    public static Gaussian SampleAverageLogarithm(double mean, Gamma precision)
    Parameters
    Type Name Description
    Double mean

    Constant value for mean.

    Gamma precision

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

    Returns
    Type Description
    Gaussian

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

    Exceptions
    Type Condition
    ImproperMessageException

    precision is not a proper distribution.

    SampleAverageLogarithm(Double, Double)

    VMP message to sample.

    Declaration
    public static Gaussian SampleAverageLogarithm(double mean, double precision)
    Parameters
    Type Name Description
    Double mean

    Constant value for mean.

    Double precision

    Constant value for precision.

    Returns
    Type Description
    Gaussian

    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.

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