Class GaussianOp_Slow
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 = false)]
[FactorMethod(new string[]{"sample", "mean", "precision"}, typeof(Factor), "Gaussian", new Type[]{}, Default = false)]
[Quality(QualityBand.Experimental)]
public class GaussianOp_Slow : GaussianOpBase
Fields
QuadratureNodeCount
Declaration
public static int QuadratureNodeCount
Field Value
| Type | Description |
|---|---|
| Int32 |
Methods
FindZeroes(Func<Double, Double>, Func<Double, Double>, IList<Double>, IList<Double>)
Find all zeroes of a function, given its stationary points and inflection points
Declaration
public static List<double> FindZeroes(Func<double, double> func, Func<double, double> deriv, IList<double> stationaryPoints, IList<double> inflectionPoints)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Double, Double> | func | |
| Func<Double, Double> | deriv | |
| IList<Double> | stationaryPoints | |
| IList<Double> | inflectionPoints |
Returns
| Type | Description |
|---|---|
| List<Double> |
GetIntegrationBoundsForPrecision(Double, Double, Double, Double, out Double, out Double, out Double)
Declaration
public static void GetIntegrationBoundsForPrecision(double m, double v, double a, double b, out double logrmin, out double logrmax, out double logrmode)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | m | |
| Double | v | |
| Double | a | |
| Double | b | |
| Double | logrmin | |
| Double | logrmax | |
| Double | logrmode |
GetRealRoots(IList<Double>, out List<Double>, Predicate<Double>)
Get the real roots of a polynomial
Declaration
public static void GetRealRoots(IList<double> coeffs, out List<double> roots, Predicate<double> filter = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<Double> | coeffs | Coefficients of the polynomial, starting from the highest degree monomial down to the constant term |
| List<Double> | roots | On exit, the real roots |
| Predicate<Double> | filter | If not null, only roots where filter returns true are included |
GetRoots(IList<Double>, out Double[], out Double[])
Get the complex roots of a polynomial
Declaration
public static void GetRoots(IList<double> coeffs, out double[] rootsReal, out double[] rootsImag)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<Double> | coeffs | Coefficients of the polynomial, starting from the highest degree monomial down to the constant term |
| Double[] | rootsReal | On exit, the real part of the roots |
| Double[] | rootsImag | On exit, the imaginary part of the roots |
LogAverageFactor(Gaussian, Gaussian, Gamma)
Evidence message for EP.
Declaration
public static double LogAverageFactor(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 | 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 |
|
LogEvidenceRatio(Gaussian, Gaussian, Gamma, Gaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Gaussian sample, Gaussian mean, Gamma precision, Gaussian to_sample)
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 |
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(Double, Gaussian, Gamma)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(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 | 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 |
|
MeanAverageConditional(Gaussian, Gaussian, Gamma)
EP message to mean.
Declaration
public static Gaussian MeanAverageConditional(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 |
|---|---|
| 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 |
|
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 |
|
SampleAverageConditional(Gaussian, Gaussian, Gamma)
EP message to sample.
Declaration
public static Gaussian SampleAverageConditional(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 |
|---|---|
| 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 |
|