Class DirichletSymmetricOp
Provides outgoing messages for DirichletSymmetric(Int32, Double), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "DirichletSymmetric", new Type[]{})]
[Quality(QualityBand.Preview)]
[Buffers(new string[]{"probMeanLog"})]
public static class DirichletSymmetricOp
Methods
AlphaAverageConditional(Gamma, Dirichlet, Gamma)
EP message to alpha
.
Declaration
[NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
public static Gamma AlphaAverageConditional(Gamma alpha, Dirichlet prob, Gamma result)
Parameters
Type | Name | Description |
---|---|---|
Gamma | alpha | Incoming message from |
Dirichlet | prob | Incoming message from |
Gamma | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Gamma |
|
Remarks
The outgoing message is a distribution matching the moments of alpha
as the random arguments are varied. The formula is proj[p(alpha) sum_(prob) p(prob) factor(prob,K,alpha)]/p(alpha)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
AlphaAverageLogarithm(Dirichlet, ConjugateDirichlet, Vector)
VMP message to alpha
.
Declaration
[Quality(QualityBand.Experimental)]
public static ConjugateDirichlet AlphaAverageLogarithm(Dirichlet prob, ConjugateDirichlet alpha, Vector probMeanLog)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
ConjugateDirichlet | alpha | Incoming message from |
Vector | probMeanLog | Buffer |
Returns
Type | Description |
---|---|
ConjugateDirichlet | 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 alpha
. The formula is exp(sum_(prob) p(prob) log(factor(prob,K,alpha)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
AlphaAverageLogarithm(Dirichlet, Gamma, Vector, Gamma)
VMP message to alpha
.
Declaration
[Quality(QualityBand.Experimental)]
public static Gamma AlphaAverageLogarithm(Dirichlet prob, Gamma alpha, Vector probMeanLog, Gamma to_Alpha)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
Gamma | alpha | Incoming message from |
Vector | probMeanLog | Buffer |
Gamma | to_Alpha | Previous outgoing message to |
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 alpha
. The formula is exp(sum_(prob) p(prob) log(factor(prob,K,alpha)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
AlphaAverageLogarithm(Vector, ConjugateDirichlet, Vector)
VMP message to alpha
.
Declaration
[Quality(QualityBand.Experimental)]
public static ConjugateDirichlet AlphaAverageLogarithm(Vector prob, ConjugateDirichlet alpha, Vector probMeanLog)
Parameters
Type | Name | Description |
---|---|---|
Vector | prob | Constant value for |
ConjugateDirichlet | alpha | Incoming message from |
Vector | probMeanLog | Buffer |
Returns
Type | Description |
---|---|
ConjugateDirichlet | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of alpha
conditioned on the given values.
AlphaAverageLogarithm(Vector, Gamma, Gamma)
VMP message to alpha
.
Declaration
[Quality(QualityBand.Experimental)]
public static Gamma AlphaAverageLogarithm(Vector prob, Gamma alpha, Gamma to_Alpha)
Parameters
Type | Name | Description |
---|---|---|
Vector | prob | Constant value for |
Gamma | alpha | Incoming message from |
Gamma | to_Alpha | Previous outgoing message to |
Returns
Type | Description |
---|---|
Gamma | The outgoing VMP message to the |
Remarks
The outgoing message is the factor viewed as a function of alpha
conditioned on the given values.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AverageLogFactor(Dirichlet, ConjugateDirichlet)
Evidence message for VMP.
Declaration
[Quality(QualityBand.Experimental)]
public static double AverageLogFactor(Dirichlet prob, ConjugateDirichlet alpha)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
ConjugateDirichlet | alpha | 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_(prob,alpha) p(prob,alpha) log(factor(prob,K,alpha))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AverageLogFactor(Dirichlet, Gamma, Vector)
Evidence message for VMP.
Declaration
[Quality(QualityBand.Experimental)]
public static double AverageLogFactor(Dirichlet prob, Gamma alpha, Vector probMeanLog)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
Gamma | alpha | Incoming message from |
Vector | probMeanLog | Buffer |
Returns
Type | Description |
---|---|
Double | Average of the factor's log-value across the given argument distributions. |
Remarks
The formula for the result is sum_(prob,alpha) p(prob,alpha) log(factor(prob,K,alpha))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
AverageLogFactor(Dirichlet, Double, Vector)
Evidence message for VMP.
Declaration
[Quality(QualityBand.Stable)]
public static double AverageLogFactor(Dirichlet prob, double alpha, Vector probMeanLog)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
Double | alpha | Constant value for |
Vector | probMeanLog | Buffer |
Returns
Type | Description |
---|---|
Double | Average of the factor's log-value across the given argument distributions. |
Remarks
The formula for the result is sum_(prob) p(prob) log(factor(prob,K,alpha))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AverageLogFactor(Vector, ConjugateDirichlet)
Evidence message for VMP.
Declaration
[Quality(QualityBand.Experimental)]
public static double AverageLogFactor(Vector prob, ConjugateDirichlet alpha)
Parameters
Type | Name | Description |
---|---|---|
Vector | prob | Constant value for |
ConjugateDirichlet | alpha | 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_(alpha) p(alpha) log(factor(prob,K,alpha))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AverageLogFactor(Vector, Gamma)
Evidence message for VMP.
Declaration
[Quality(QualityBand.Experimental)]
public static double AverageLogFactor(Vector prob, Gamma alpha)
Parameters
Type | Name | Description |
---|---|---|
Vector | prob | Constant value for |
Gamma | alpha | 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_(alpha) p(alpha) log(factor(prob,K,alpha))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
AverageLogFactor(IList<Double>, Double)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(IList<double> prob, double alpha)
Parameters
Type | Name | Description |
---|---|---|
IList<Double> | prob | Incoming message from |
Double | alpha | 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_(prob) p(prob) log(factor(prob,K,alpha))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
LogAverageFactor(Dirichlet, Gamma)
Evidence message for EP.
Declaration
[NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
public static double LogAverageFactor(Dirichlet prob, Gamma alpha)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
Gamma | alpha | 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_(prob,alpha) p(prob,alpha) factor(prob,K,alpha))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
LogAverageFactor(Dirichlet, Double)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Dirichlet prob, double alpha)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
Double | alpha | 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(sum_(prob) p(prob) factor(prob,K,alpha))
.
LogAverageFactor(IList<Double>, Double)
Evidence message for EP.
Declaration
public static double LogAverageFactor(IList<double> prob, double alpha)
Parameters
Type | Name | Description |
---|---|---|
IList<Double> | prob | Incoming message from |
Double | alpha | 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(sum_(prob) p(prob) factor(prob,K,alpha))
.
LogEvidenceRatio(Dirichlet, Double)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Dirichlet prob, double alpha)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
Double | alpha | 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_(prob) p(prob) factor(prob,K,alpha) / sum_prob p(prob) messageTo(prob))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(IList<Double>, Double)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(IList<double> prob, double alpha)
Parameters
Type | Name | Description |
---|---|---|
IList<Double> | prob | Incoming message from |
Double | alpha | 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_(prob) p(prob) factor(prob,K,alpha) / sum_prob p(prob) messageTo(prob))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
ProbAverageConditional(Gamma, Dirichlet)
EP message to prob
.
Declaration
[NotSupported("Expectation Propagation does not currently support Dirichlet distributions with stochastic arguments")]
public static Dirichlet ProbAverageConditional(Gamma alpha, Dirichlet result)
Parameters
Type | Name | Description |
---|---|---|
Gamma | alpha | Incoming message from |
Dirichlet | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Dirichlet |
|
Remarks
The outgoing message is a distribution matching the moments of prob
as the random arguments are varied. The formula is proj[p(prob) sum_(alpha) p(alpha) factor(prob,K,alpha)]/p(prob)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ProbAverageConditional(Double, Dirichlet)
EP message to prob
.
Declaration
public static Dirichlet ProbAverageConditional(double alpha, Dirichlet result)
Parameters
Type | Name | Description |
---|---|---|
Double | alpha | Constant value for |
Dirichlet | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Dirichlet |
|
Remarks
The outgoing message is the factor viewed as a function of prob
conditioned on the given values.
ProbAverageConditionalInit(Int32)
Declaration
public static Dirichlet ProbAverageConditionalInit(int K)
Parameters
Type | Name | Description |
---|---|---|
Int32 | K | Constant value for |
Returns
Type | Description |
---|---|
Dirichlet |
Remarks
ProbAverageLogarithm(ConjugateDirichlet, Dirichlet)
VMP message to prob
.
Declaration
[Quality(QualityBand.Experimental)]
public static Dirichlet ProbAverageLogarithm(ConjugateDirichlet alpha, Dirichlet result)
Parameters
Type | Name | Description |
---|---|---|
ConjugateDirichlet | alpha | Incoming message from |
Dirichlet | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Dirichlet |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except prob
. The formula is exp(sum_(alpha) p(alpha) log(factor(prob,K,alpha)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ProbAverageLogarithm(Gamma, Dirichlet)
VMP message to prob
.
Declaration
[Quality(QualityBand.Experimental)]
public static Dirichlet ProbAverageLogarithm(Gamma alpha, Dirichlet result)
Parameters
Type | Name | Description |
---|---|---|
Gamma | alpha | Incoming message from |
Dirichlet | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Dirichlet |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except prob
. The formula is exp(sum_(alpha) p(alpha) log(factor(prob,K,alpha)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ProbAverageLogarithm(Double, Dirichlet)
VMP message to prob
.
Declaration
[Quality(QualityBand.Stable)]
public static Dirichlet ProbAverageLogarithm(double alpha, Dirichlet result)
Parameters
Type | Name | Description |
---|---|---|
Double | alpha | Constant value for |
Dirichlet | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Dirichlet |
|
Remarks
The outgoing message is the factor viewed as a function of prob
conditioned on the given values.
ProbAverageLogarithmInit(Int32)
Declaration
public static Dirichlet ProbAverageLogarithmInit(int K)
Parameters
Type | Name | Description |
---|---|---|
Int32 | K | Constant value for |
Returns
Type | Description |
---|---|
Dirichlet |
Remarks
ProbMeanLog(Dirichlet, Vector)
Update the buffer probMeanLog
.
Declaration
public static Vector ProbMeanLog(Dirichlet prob, Vector result)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
Vector | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Vector |
|
Remarks
ProbMeanLog(Vector, Vector)
Update the buffer probMeanLog
.
Declaration
public static Vector ProbMeanLog(Vector prob, Vector result)
Parameters
Type | Name | Description |
---|---|---|
Vector | prob | Constant value for |
Vector | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Vector |
|
Remarks
ProbMeanLogInit(Dirichlet)
Initialize the buffer probMeanLog
.
Declaration
public static Vector ProbMeanLogInit(Dirichlet prob)
Parameters
Type | Name | Description |
---|---|---|
Dirichlet | prob | Incoming message from |
Returns
Type | Description |
---|---|
Vector | Initial value of buffer |
Remarks
ProbMeanLogInit(Vector)
Initialize the buffer probMeanLog
.
Declaration
public static Vector ProbMeanLogInit(Vector prob)
Parameters
Type | Name | Description |
---|---|---|
Vector | prob | Constant value for |
Returns
Type | Description |
---|---|
Vector | Initial value of buffer |
Remarks