Class IsPositiveOp
Provides outgoing messages for IsPositive(Double), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "IsPositive", new Type[]{typeof(double)})]
[Quality(QualityBand.Mature)]
public static class IsPositiveOp
Methods
AverageLogFactor(Bernoulli, Gaussian, Gaussian)
Evidence message for VMP.
Declaration
[Quality(QualityBand.Preview)]
public static double AverageLogFactor(Bernoulli isPositive, Gaussian X, Gaussian to_X)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | isPositive | Incoming message from |
Gaussian | X | Incoming message from |
Gaussian | to_X | Previous outgoing message to |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
In Variational Message Passing, the evidence contribution of a deterministic factor is zero. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AverageLogFactor(TruncatedGaussian)
Evidence message for VMP.
Declaration
[Quality(QualityBand.Preview)]
public static double AverageLogFactor(TruncatedGaussian X)
Parameters
Type | Name | Description |
---|---|---|
TruncatedGaussian | X | Incoming message from |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
In Variational Message Passing, the evidence contribution of a deterministic factor is zero. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor(Boolean, Gaussian, Gaussian)
Evidence message for VMP.
Declaration
[Quality(QualityBand.Preview)]
public static double AverageLogFactor(bool isPositive, Gaussian x, Gaussian to_X)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Gaussian | x | Incoming message from |
Gaussian | to_X | Previous outgoing message to |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
In Variational Message Passing, the evidence contribution of a deterministic factor is zero. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AverageLogFactor(Boolean, Double)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(bool isPositive, double x)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Double | x | Constant value for |
Returns
Type | Description |
---|---|
Double | Zero. |
Remarks
The formula for the result is log(factor(isPositive,x))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor_helper(Gaussian, Gaussian)
Evidence message for VMP
Declaration
[Quality(QualityBand.Preview)]
public static double AverageLogFactor_helper(Gaussian X, Gaussian to_X)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | X | Incoming message from 'x'. Must be a proper distribution. If uniform, the result will be uniform. |
Gaussian | to_X | Previous outgoing message to 'X'. |
Returns
Type | Description |
---|---|
Double | Zero |
Remarks
In Variational Message Passing, the evidence contribution of a deterministic factor is zero. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
IsPositiveAverageConditional(Gaussian)
EP message to isPositive
.
Declaration
public static Bernoulli IsPositiveAverageConditional(Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | x | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of isPositive
as the random arguments are varied. The formula is proj[p(isPositive) sum_(x) p(x) factor(isPositive,x)]/p(isPositive)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
IsPositiveAverageConditionalInit()
Declaration
public static Bernoulli IsPositiveAverageConditionalInit()
Returns
Type | Description |
---|---|
Bernoulli |
Remarks
IsPositiveAverageLogarithm(Gaussian)
VMP message to isPositive
.
Declaration
[Quality(QualityBand.Preview)]
public static Bernoulli IsPositiveAverageLogarithm(Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | x | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is a distribution matching the moments of isPositive
as the random arguments are varied. The formula is proj[sum_(x) p(x) factor(isPositive,x)]
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
LogAverageFactor(Bernoulli, Gaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Bernoulli isPositive, Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | isPositive | Incoming message from |
Gaussian | x | 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_(isPositive,x) p(isPositive,x) factor(isPositive,x))
.
LogAverageFactor(Boolean, Gaussian)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool isPositive, Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Gaussian | x | 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_(x) p(x) factor(isPositive,x))
.
LogAverageFactor(Boolean, Double)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool isPositive, double x)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Double | x | Constant value for |
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(isPositive,x))
.
LogEvidenceRatio(Bernoulli, Gaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Bernoulli isPositive, Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | isPositive | Incoming message from |
Gaussian | x | 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_(isPositive,x) p(isPositive,x) factor(isPositive,x) / sum_isPositive p(isPositive) messageTo(isPositive))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, Gaussian)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool isPositive, Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Gaussian | x | 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_(x) p(x) factor(isPositive,x))
. 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 isPositive, double x)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Double | x | Constant value for |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(factor(isPositive,x))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
XAverageConditional(Bernoulli)
EP message to x
.
Declaration
[Quality(QualityBand.Preview)]
public static TruncatedGaussian XAverageConditional(Bernoulli isPositive)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | isPositive | Incoming message from |
Returns
Type | Description |
---|---|
TruncatedGaussian | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of x
as the random arguments are varied. The formula is proj[p(x) sum_(isPositive) p(isPositive) factor(isPositive,x)]/p(x)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
XAverageConditional(Bernoulli, Gaussian)
EP message to x
.
Declaration
public static Gaussian XAverageConditional(Bernoulli isPositive, Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | isPositive | Incoming message from |
Gaussian | x | Incoming message from |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of x
as the random arguments are varied. The formula is proj[p(x) sum_(isPositive) p(isPositive) factor(isPositive,x)]/p(x)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
XAverageConditional(Bernoulli, Double)
EP message to x
.
Declaration
public static Gaussian XAverageConditional(Bernoulli isPositive, double x)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | isPositive | Incoming message from |
Double | x | Constant value for |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of x
as the random arguments are varied. The formula is proj[p(x) sum_(isPositive) p(isPositive) factor(isPositive,x)]/p(x)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
XAverageConditional(Boolean)
EP message to x
.
Declaration
[Quality(QualityBand.Preview)]
public static TruncatedGaussian XAverageConditional(bool isPositive)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Returns
Type | Description |
---|---|
TruncatedGaussian | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of x
conditioned on the given values.
XAverageConditional(Boolean, Gaussian)
EP message to x
.
Declaration
public static Gaussian XAverageConditional(bool isPositive, Gaussian x)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Gaussian | x | Incoming message from |
Returns
Type | Description |
---|---|
Gaussian | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of x
conditioned on the given values.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
XAverageConditional_Helper(Bernoulli, Gaussian, Boolean)
Declaration
public static Gaussian XAverageConditional_Helper(Bernoulli isPositive, Gaussian x, bool forceProper)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | isPositive | |
Gaussian | x | |
Boolean | forceProper |
Returns
Type | Description |
---|---|
Gaussian |
XAverageConditionalInit()
Declaration
public static Gaussian XAverageConditionalInit()
Returns
Type | Description |
---|---|
Gaussian |
Remarks
XAverageLogarithm(Bernoulli, Gaussian, Gaussian)
VMP message to x
.
Declaration
[Quality(QualityBand.Preview)]
public static Gaussian XAverageLogarithm(Bernoulli isPositive, Gaussian x, Gaussian to_X)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | isPositive | Incoming message from |
Gaussian | x | Incoming message from |
Gaussian | to_X | Previous outgoing message to |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of x
with isPositive
integrated out. The formula is sum_isPositive p(isPositive) factor(isPositive,x)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
XAverageLogarithm(Boolean)
VMP message to x
.
Declaration
[Quality(QualityBand.Preview)]
public static TruncatedGaussian XAverageLogarithm(bool isPositive)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Returns
Type | Description |
---|---|
TruncatedGaussian | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of x
conditioned on the given values.
XAverageLogarithm(Boolean, Gaussian, Gaussian)
VMP message to x
.
Declaration
[Quality(QualityBand.Preview)]
public static Gaussian XAverageLogarithm(bool isPositive, Gaussian x, Gaussian to_X)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isPositive | Constant value for |
Gaussian | x | Incoming message from |
Gaussian | to_X | Previous outgoing message to |
Returns
Type | Description |
---|---|
Gaussian | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of x
conditioned on the given values.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|