Class BernoulliFromBetaOp
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(Bernoulli), "Sample", new Type[]{typeof(double)})]
[FactorMethod(new string[]{"Sample", "ProbTrue"}, typeof(Factor), "Bernoulli", new Type[]{})]
[Quality(QualityBand.Mature)]
public static class BernoulliFromBetaOp
Methods
AverageLogFactor(Bernoulli, Beta)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(Bernoulli sample, Beta probTrue)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | sample | Incoming message from |
Beta | probTrue | 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,probTrue) p(sample,probTrue) log(factor(sample,probTrue))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AverageLogFactor(Bernoulli, Double)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(Bernoulli sample, double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | sample | Incoming message from |
Double | probTrue | 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,probTrue))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
AverageLogFactor(Boolean, Beta)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(bool sample, Beta probTrue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Beta | probTrue | 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_(probTrue) p(probTrue) log(factor(sample,probTrue))
. 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 sample, double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Double | probTrue | 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,probTrue))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
LogAverageFactor(Bernoulli, Bernoulli)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Bernoulli sample, Bernoulli to_sample)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | sample | Incoming message from |
Bernoulli | to_sample | 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) p(sample) factor(sample,probTrue))
.
LogAverageFactor(Boolean, Beta)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool sample, Beta probTrue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Beta | probTrue | 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_(probTrue) p(probTrue) factor(sample,probTrue))
.
LogAverageFactor(Boolean, Double)
Evidence message for EP.
Declaration
public static double LogAverageFactor(bool sample, double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Double | probTrue | 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(sample,probTrue))
.
LogEvidenceRatio(Bernoulli, Beta)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Bernoulli sample, Beta probTrue)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | sample | Incoming message from |
Beta | probTrue | 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_(sample,probTrue) p(sample,probTrue) factor(sample,probTrue) / sum_sample p(sample) messageTo(sample))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Bernoulli, Double)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Bernoulli sample, double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | sample | Incoming message from |
Double | probTrue | 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(sum_(sample) p(sample) factor(sample,probTrue) / sum_sample p(sample) messageTo(sample))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(Boolean, Beta)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(bool sample, Beta probTrue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Beta | probTrue | 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_(probTrue) p(probTrue) factor(sample,probTrue))
. 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 sample, double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Double | probTrue | 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(sample,probTrue))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
ProbTrueAverageConditional(Bernoulli, Beta)
EP message to probTrue
.
Declaration
public static Beta ProbTrueAverageConditional(Bernoulli sample, Beta probTrue)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | sample | Incoming message from |
Beta | probTrue | Incoming message from |
Returns
Type | Description |
---|---|
Beta | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of probTrue
as the random arguments are varied. The formula is proj[p(probTrue) sum_(sample) p(sample) factor(sample,probTrue)]/p(probTrue)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ProbTrueAverageConditional(Bernoulli, Double)
Declaration
public static Beta ProbTrueAverageConditional(Bernoulli sample, double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | sample | |
Double | probTrue |
Returns
Type | Description |
---|---|
Beta |
ProbTrueAverageConditional(Boolean)
EP message to probTrue
.
Declaration
public static Beta ProbTrueAverageConditional(bool sample)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Returns
Type | Description |
---|---|
Beta | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of probTrue
conditioned on the given values.
ProbTrueAverageLogarithm(Bernoulli)
VMP message to probTrue
.
Declaration
public static Beta ProbTrueAverageLogarithm(Bernoulli sample)
Parameters
Type | Name | Description |
---|---|---|
Bernoulli | sample | Incoming message from |
Returns
Type | Description |
---|---|
Beta | 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 probTrue
. The formula is exp(sum_(sample) p(sample) log(factor(sample,probTrue)))
.
ProbTrueAverageLogarithm(Boolean)
VMP message to probTrue
.
Declaration
public static Beta ProbTrueAverageLogarithm(bool sample)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Returns
Type | Description |
---|---|
Beta | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of probTrue
conditioned on the given values.
ProbTrueConditional(Boolean)
Gibbs message to probTrue
.
Declaration
public static Beta ProbTrueConditional(bool sample)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sample | Constant value for |
Returns
Type | Description |
---|---|
Beta | The outgoing Gibbs message to the |
Remarks
The outgoing message is the factor viewed as a function of probTrue
conditioned on the given values.
SampleAverageConditional(Beta)
EP message to sample
.
Declaration
public static Bernoulli SampleAverageConditional(Beta probTrue)
Parameters
Type | Name | Description |
---|---|---|
Beta | probTrue | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | 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_(probTrue) p(probTrue) factor(sample,probTrue)]/p(sample)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SampleAverageConditional(Double)
EP message to sample
.
Declaration
public static Bernoulli SampleAverageConditional(double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Double | probTrue | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing EP message to the |
Remarks
The outgoing message is the factor viewed as a function of sample
conditioned on the given values.
SampleAverageLogarithm(Beta)
VMP message to sample
.
Declaration
public static Bernoulli SampleAverageLogarithm(Beta probTrue)
Parameters
Type | Name | Description |
---|---|---|
Beta | probTrue | Incoming message from |
Returns
Type | Description |
---|---|
Bernoulli | 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_(probTrue) p(probTrue) log(factor(sample,probTrue)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SampleAverageLogarithm(Double)
VMP message to sample
.
Declaration
public static Bernoulli SampleAverageLogarithm(double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Double | probTrue | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of sample
conditioned on the given values.
SampleConditional(Double)
Gibbs message to sample
.
Declaration
public static Bernoulli SampleConditional(double probTrue)
Parameters
Type | Name | Description |
---|---|---|
Double | probTrue | Constant value for |
Returns
Type | Description |
---|---|
Bernoulli | The outgoing Gibbs message to the |
Remarks
The outgoing message is the factor viewed as a function of sample
conditioned on the given values.