Search Results for

    Show / Hide Table of Contents

    Class GaussianOp_Laplace

    Provides outgoing messages for the following factors:

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

    Inheritance
    Object
    GaussianOpBase
    GaussianOp_Laplace
    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 = false)]
    [FactorMethod(new string[]{"sample", "mean", "precision"}, typeof(Factor), "Gaussian", new Type[]{}, Default = false)]
    [Buffers(new string[]{"Q"})]
    [Quality(QualityBand.Experimental)]
    public class GaussianOp_Laplace : GaussianOpBase

    Fields

    modified

    Declaration
    public static bool modified
    Field Value
    Type Description
    Boolean

    modified2

    Declaration
    public static bool modified2
    Field Value
    Type Description
    Boolean

    Methods

    dlogfs(Double, Double, Double)

    Derivatives of the factor wrt precision

    Declaration
    public static double[] dlogfs(double x, double m, double v)
    Parameters
    Type Name Description
    Double x
    Double m
    Double v
    Returns
    Type Description
    Double[]

    dlogfxs(Double, Gamma)

    Declaration
    public static double[] dlogfxs(double x, Gamma precision)
    Parameters
    Type Name Description
    Double x
    Gamma precision
    Returns
    Type Description
    Double[]

    LaplaceMoments(Gamma, Double[], Double[], out Double, out Double)

    Approximate the mean and variance of a function g(x) where x is distributed according to a Gamma times f(x).

    Declaration
    public static void LaplaceMoments(Gamma q, double[] g, double[] dlogf, out double m, out double v)
    Parameters
    Type Name Description
    Gamma q

    The Gamma distribution that multiplies f

    Double[] g

    g[0] = g(xhat), g[1] = g'(xhat), g[2] = g''(xhat), and so on.

    Double[] dlogf

    dlogf[0] = (logf)'(xhat), dlogf[1] = (logf)''(xhat), and so on.

    Double m
    Double v

    LaplaceMoments(Gaussian, Double[], out Double, out Double)

    Declaration
    public static void LaplaceMoments(Gaussian q, double[] dlogfx, out double m, out double v)
    Parameters
    Type Name Description
    Gaussian q
    Double[] dlogfx
    Double m
    Double v

    LaplaceMoments2(Gamma, Double[], Double[], out Double, out Double)

    Declaration
    public static void LaplaceMoments2(Gamma q, double[] xg, double[] xdlogf, out double m, out double v)
    Parameters
    Type Name Description
    Gamma q
    Double[] xg
    Double[] xdlogf
    Double m
    Double v

    LogAverageFactor(Gaussian, Gaussian, Gamma, Gamma)

    Evidence message for EP.

    Declaration
    public static double LogAverageFactor(Gaussian sample, Gaussian mean, Gamma precision, Gamma q)
    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.

    Gamma q

    Buffer q.

    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.

    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 q)
    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 q

    Buffer q.

    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(Double, Gaussian, Gamma, Gamma)

    Evidence message for EP.

    Declaration
    public static double LogEvidenceRatio(double sample, Gaussian mean, Gamma precision, Gamma q)
    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 q

    Buffer q.

    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.

    MeanAverageConditional(Gaussian, Gaussian, Gamma, Gamma)

    EP message to mean.

    Declaration
    public static Gaussian MeanAverageConditional(Gaussian sample, Gaussian mean, Gamma precision, Gamma q)
    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 q

    Buffer q.

    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.

    PrecisionAverageConditional(Gaussian, Gaussian, Gamma, Gamma)

    EP message to precision.

    Declaration
    public static Gamma PrecisionAverageConditional(Gaussian sample, Gaussian mean, Gamma precision, Gamma q)
    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 q

    Buffer q.

    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_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

    Q(Gaussian, Gaussian, Gamma, Gamma)

    Update the buffer Q.

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

    Incoming message from sample.

    Gaussian mean

    Incoming message from mean.

    Gamma precision

    Incoming message from precision.

    Gamma q

    Buffer q.

    Returns
    Type Description
    Gamma

    New value of buffer Q.

    Remarks

    Q_Slow(Gaussian, Gaussian, Gamma)

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

    QInit()

    Initialize the buffer Q.

    Declaration
    public static Gamma QInit()
    Returns
    Type Description
    Gamma

    Initial value of buffer Q.

    Remarks

    Qx(Gaussian, Gamma, Gaussian)

    Declaration
    public static Gaussian Qx(Gaussian y, Gamma precision, Gaussian qx)
    Parameters
    Type Name Description
    Gaussian y
    Gamma precision
    Gaussian qx
    Returns
    Type Description
    Gaussian

    SampleAverageConditional(Gaussian, Gaussian, Gamma, Gamma)

    EP message to sample.

    Declaration
    public static Gaussian SampleAverageConditional(Gaussian sample, Gaussian mean, Gamma precision, Gamma q)
    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 q

    Buffer q.

    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.

    xdlogfs(Double, Double, Double)

    Derivatives of the factor wrt precision, times powers of x

    Declaration
    public static double[] xdlogfs(double x, double m, double v)
    Parameters
    Type Name Description
    Double x
    Double m
    Double v
    Returns
    Type Description
    Double[]
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.