Class GaussianOp
Provides outgoing messages for the following factors:
, given random arguments to the function.Inherited Members
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
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 |
|
| ImproperMessageException |
|
| ImproperMessageException |
|
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 |
| Gaussian | mean | Incoming message from |
| Double | precision | Constant value for |
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 |
|
| ImproperMessageException |
|
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 |
| Double | mean | Constant value for |
| Gamma | precision | Incoming message from |
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 |
|
| ImproperMessageException |
|
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 |
| Double | mean | Constant value for |
| Double | precision | Constant value for |
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 |
|
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
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 |
|
| ImproperMessageException |
|
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 |
| Gaussian | mean | Incoming message from |
| Double | precision | Constant value for |
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 |
|
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 |
| Double | mean | Constant value for |
| Gamma | precision | Incoming message from |
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 |
|
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 |
| Double | mean | Constant value for |
| Double | precision | Constant value for |
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
| Gamma | to_precision | Previous outgoing message to |
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 |
|
| ImproperMessageException |
|
| ImproperMessageException |
|
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 |
| Double | mean | Constant value for |
| Gamma | precision | Incoming message from |
| Gamma | to_precision | Previous outgoing message to |
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 |
|
| ImproperMessageException |
|
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
| Gamma | to_precision | Previous outgoing message to |
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 |
|
| ImproperMessageException |
|
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
| Gaussian | to_sample | Outgoing message to |
| Gamma | to_precision | Previous outgoing message to |
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 |
|
| ImproperMessageException |
|
| ImproperMessageException |
|
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 |
| Double | mean | Constant value for |
| Gamma | precision | Incoming message from |
| Gaussian | to_sample | Outgoing message to |
| Gamma | to_precision | Previous outgoing message to |
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 |
|
| ImproperMessageException |
|
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
| Gamma | to_precision | Previous outgoing message to |
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 |
|
| ImproperMessageException |
|
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 |
| Double | mean | Constant value for |
| Double | precision | Constant value for |
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
| Gamma | to_precision | Previous outgoing message to |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing EP message to the |
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 |
|
| ImproperMessageException |
|
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
| Gamma | to_precision | Previous outgoing message to |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing EP message to the |
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 |
|
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 |
| Double | precision | Constant value for |
| TruncatedGaussian | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| TruncatedGaussian |
|
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 |
| Gamma | precision | Incoming message from |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing VMP message to the |
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 |
|
| ImproperMessageException |
|
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 |
| Double | precision | Constant value for |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing VMP message to the |
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 |
|
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 |
| Gamma | precision | Incoming message from |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing VMP message to the |
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 |
|
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 |
| Double | precision | Constant value for |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing VMP message to the |
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
Returns
| Type | Description |
|---|---|
| Gamma | The outgoing EP message to the |
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 |
|
| ImproperMessageException |
|
| ImproperMessageException |
|
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 |
| Gaussian | mean | Incoming message from |
Returns
| Type | Description |
|---|---|
| Gamma | The outgoing VMP message to the |
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 |
|
| ImproperMessageException |
|
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 |
| Double | mean | Constant value for |
Returns
| Type | Description |
|---|---|
| Gamma | The outgoing VMP message to the |
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 |
|
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 |
| Gaussian | mean | Incoming message from |
Returns
| Type | Description |
|---|---|
| Gamma | The outgoing VMP message to the |
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 |
|
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 |
| Double | mean | Constant value for |
Returns
| Type | Description |
|---|---|
| Gamma | The outgoing VMP message to the |
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 |
| Gaussian | mean | Incoming message from |
| Gamma | precision | Incoming message from |
| Gamma | to_precision | Previous outgoing message to |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing EP message to the |
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 |
|
| ImproperMessageException |
|
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 |
| Double | mean | Constant value for |
| Gamma | precision | Incoming message from |
| Gamma | to_precision | Previous outgoing message to |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing EP message to the |
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 |
|
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 |
| Double | precision | Constant value for |
| TruncatedGaussian | result | Modified to contain the outgoing message. |
Returns
| Type | Description |
|---|---|
| TruncatedGaussian |
|
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 |
| Gamma | precision | Incoming message from |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing VMP message to the |
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 |
|
| ImproperMessageException |
|
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 |
| Double | precision | Constant value for |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing VMP message to the |
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 |
|
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 |
| Gamma | precision | Incoming message from |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing VMP message to the |
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 |
|
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 |
| Double | precision | Constant value for |
Returns
| Type | Description |
|---|---|
| Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of sample conditioned on the given values.