Class SparseBernoulliFromBetaOp
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(SparseBernoulliList), "Sample", new Type[]{typeof(ISparseList<double>)})]
[Quality(QualityBand.Stable)]
public class SparseBernoulliFromBetaOp
Methods
AverageLogFactor(ISparseList<Boolean>, ISparseList<Double>)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(ISparseList<bool> sample, ISparseList<double> probTrue)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
ISparseList<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.
AverageLogFactor(ISparseList<Boolean>, SparseBetaList)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(ISparseList<bool> sample, SparseBetaList probTrue)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
SparseBetaList | 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(SparseBernoulliList, ISparseList<Double>)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(SparseBernoulliList sample, ISparseList<double> probTrue)
Parameters
Type | Name | Description |
---|---|---|
SparseBernoulliList | sample | Incoming message from |
ISparseList<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(SparseBernoulliList, SparseBetaList)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(SparseBernoulliList sample, SparseBetaList probTrue)
Parameters
Type | Name | Description |
---|---|---|
SparseBernoulliList | sample | Incoming message from |
SparseBetaList | 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 |
|
LogAverageFactor(ISparseList<Boolean>, ISparseList<Double>)
Evidence message for EP.
Declaration
public static double LogAverageFactor(ISparseList<bool> sample, ISparseList<double> probTrue)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
ISparseList<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))
.
LogAverageFactor(ISparseList<Boolean>, SparseBetaList)
Evidence message for EP.
Declaration
public static double LogAverageFactor(ISparseList<bool> sample, SparseBetaList probTrue)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
SparseBetaList | 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(SparseBernoulliList, SparseBernoulliList)
Evidence message for EP.
Declaration
public static double LogAverageFactor(SparseBernoulliList sample, SparseBernoulliList to_sample)
Parameters
Type | Name | Description |
---|---|---|
SparseBernoulliList | sample | Incoming message from |
SparseBernoulliList | 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))
.
LogEvidenceRatio(ISparseList<Boolean>, ISparseList<Double>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(ISparseList<bool> sample, ISparseList<double> probTrue)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
ISparseList<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.
LogEvidenceRatio(ISparseList<Boolean>, SparseBetaList)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(ISparseList<bool> sample, SparseBetaList probTrue)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
SparseBetaList | 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(SparseBernoulliList, ISparseList<Double>)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(SparseBernoulliList sample, ISparseList<double> probTrue)
Parameters
Type | Name | Description |
---|---|---|
SparseBernoulliList | sample | Incoming message from |
ISparseList<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(SparseBernoulliList, SparseBetaList)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(SparseBernoulliList sample, SparseBetaList probTrue)
Parameters
Type | Name | Description |
---|---|---|
SparseBernoulliList | sample | Incoming message from |
SparseBetaList | 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.
ProbTrueAverageConditional(ISparseList<Boolean>, SparseBetaList)
EP message to probTrue
.
Declaration
public static SparseBetaList ProbTrueAverageConditional(ISparseList<bool> sample, SparseBetaList result)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
SparseBetaList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBetaList |
|
Remarks
The outgoing message is the factor viewed as a function of probTrue
conditioned on the given values.
ProbTrueAverageConditional(SparseBernoulliList, SparseBetaList, SparseBetaList)
EP message to probTrue
.
Declaration
public static SparseBetaList ProbTrueAverageConditional(SparseBernoulliList sample, SparseBetaList probTrue, SparseBetaList result)
Parameters
Type | Name | Description |
---|---|---|
SparseBernoulliList | sample | Incoming message from |
SparseBetaList | probTrue | Incoming message from |
SparseBetaList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBetaList |
|
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 |
|
ProbTrueAverageLogarithm(ISparseList<Boolean>, SparseBetaList)
VMP message to probTrue
.
Declaration
public static SparseBetaList ProbTrueAverageLogarithm(ISparseList<bool> sample, SparseBetaList result)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
SparseBetaList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBetaList |
|
Remarks
The outgoing message is the factor viewed as a function of probTrue
conditioned on the given values.
ProbTrueAverageLogarithm(SparseBernoulliList, SparseBetaList)
VMP message to probTrue
.
Declaration
public static SparseBetaList ProbTrueAverageLogarithm(SparseBernoulliList sample, SparseBetaList result)
Parameters
Type | Name | Description |
---|---|---|
SparseBernoulliList | sample | Incoming message from |
SparseBetaList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBetaList |
|
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)))
.
ProbTrueConditional(ISparseList<Boolean>, SparseBetaList)
Gibbs message to probTrue
.
Declaration
public static SparseBetaList ProbTrueConditional(ISparseList<bool> sample, SparseBetaList result)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Boolean> | sample | Constant value for |
SparseBetaList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBetaList |
|
Remarks
The outgoing message is the factor viewed as a function of probTrue
conditioned on the given values.
SampleAverageConditional(ISparseList<Double>, SparseBernoulliList)
EP message to sample
.
Declaration
public static SparseBernoulliList SampleAverageConditional(ISparseList<double> probTrue, SparseBernoulliList result)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Double> | probTrue | Constant value for |
SparseBernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBernoulliList |
|
Remarks
The outgoing message is the factor viewed as a function of sample
conditioned on the given values.
SampleAverageConditional(SparseBetaList, SparseBernoulliList)
EP message to sample
.
Declaration
public static SparseBernoulliList SampleAverageConditional(SparseBetaList probTrue, SparseBernoulliList result)
Parameters
Type | Name | Description |
---|---|---|
SparseBetaList | probTrue | Incoming message from |
SparseBernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBernoulliList |
|
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 |
|
SampleAverageLogarithm(ISparseList<Double>, SparseBernoulliList)
VMP message to sample
.
Declaration
public static SparseBernoulliList SampleAverageLogarithm(ISparseList<double> probTrue, SparseBernoulliList result)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Double> | probTrue | Constant value for |
SparseBernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBernoulliList |
|
Remarks
The outgoing message is the factor viewed as a function of sample
conditioned on the given values.
SampleAverageLogarithm(SparseBetaList, SparseBernoulliList)
VMP message to sample
.
Declaration
public static SparseBernoulliList SampleAverageLogarithm(SparseBetaList probTrue, SparseBernoulliList result)
Parameters
Type | Name | Description |
---|---|---|
SparseBetaList | probTrue | Incoming message from |
SparseBernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBernoulliList |
|
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 |
|
SampleConditional(ISparseList<Double>, SparseBernoulliList)
Gibbs message to sample
.
Declaration
public static SparseBernoulliList SampleConditional(ISparseList<double> probTrue, SparseBernoulliList result)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Double> | probTrue | Constant value for |
SparseBernoulliList | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
SparseBernoulliList |
|
Remarks
The outgoing message is the factor viewed as a function of sample
conditioned on the given values.