Class WishartFromShapeAndRateOp
Provides outgoing messages for SampleFromShapeAndRate(Double, PositiveDefiniteMatrix), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Wishart), "SampleFromShapeAndRate", new Type[]{typeof(double), typeof(PositiveDefiniteMatrix)})]
[Quality(QualityBand.Stable)]
public static class WishartFromShapeAndRateOp
Methods
AverageLogFactor(Wishart, Double, Wishart)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(Wishart sample, double shape, Wishart rate)
Parameters
Type | Name | Description |
---|---|---|
Wishart | sample | Incoming message from |
Double | shape | Constant value for |
Wishart | rate | 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,rate) p(sample,rate) log(factor(sample,shape,rate))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
AverageLogFactor(PositiveDefiniteMatrix, Double, PositiveDefiniteMatrix)
Evidence message for VMP.
Declaration
public static double AverageLogFactor(PositiveDefiniteMatrix sample, double shape, PositiveDefiniteMatrix rate)
Parameters
Type | Name | Description |
---|---|---|
PositiveDefiniteMatrix | sample | Constant value for |
Double | shape | Constant value for |
PositiveDefiniteMatrix | rate | 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,shape,rate))
. Adding up these values across all factors and variables gives the log-evidence estimate for VMP.
LogAverageFactor(Wishart, Wishart)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Wishart sample, Wishart to_sample)
Parameters
Type | Name | Description |
---|---|---|
Wishart | sample | Incoming message from |
Wishart | 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,shape,rate))
.
LogAverageFactor(PositiveDefiniteMatrix, Double, Wishart)
Evidence message for EP.
Declaration
public static double LogAverageFactor(PositiveDefiniteMatrix sample, double shape, Wishart rate)
Parameters
Type | Name | Description |
---|---|---|
PositiveDefiniteMatrix | sample | Constant value for |
Double | shape | Constant value for |
Wishart | rate | 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_(rate) p(rate) factor(sample,shape,rate))
.
LogAverageFactor(PositiveDefiniteMatrix, Double, PositiveDefiniteMatrix)
Evidence message for EP.
Declaration
public static double LogAverageFactor(PositiveDefiniteMatrix sample, double shape, PositiveDefiniteMatrix rate)
Parameters
Type | Name | Description |
---|---|---|
PositiveDefiniteMatrix | sample | Constant value for |
Double | shape | Constant value for |
PositiveDefiniteMatrix | rate | 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,shape,rate))
.
LogEvidenceRatio(Wishart, Double, PositiveDefiniteMatrix)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Wishart sample, double shape, PositiveDefiniteMatrix rate)
Parameters
Type | Name | Description |
---|---|---|
Wishart | sample | Incoming message from |
Double | shape | Constant value for |
PositiveDefiniteMatrix | rate | 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,shape,rate) / sum_sample p(sample) messageTo(sample))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(PositiveDefiniteMatrix, Double, Wishart)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(PositiveDefiniteMatrix sample, double shape, Wishart rate)
Parameters
Type | Name | Description |
---|---|---|
PositiveDefiniteMatrix | sample | Constant value for |
Double | shape | Constant value for |
Wishart | rate | 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_(rate) p(rate) factor(sample,shape,rate))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
LogEvidenceRatio(PositiveDefiniteMatrix, Double, PositiveDefiniteMatrix)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(PositiveDefiniteMatrix sample, double shape, PositiveDefiniteMatrix rate)
Parameters
Type | Name | Description |
---|---|---|
PositiveDefiniteMatrix | sample | Constant value for |
Double | shape | Constant value for |
PositiveDefiniteMatrix | rate | 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,shape,rate))
. Adding up these values across all factors and variables gives the log-evidence estimate for EP.
RateAverageConditional(PositiveDefiniteMatrix, Double, Wishart)
EP message to rate
.
Declaration
public static Wishart RateAverageConditional(PositiveDefiniteMatrix sample, double shape, Wishart result)
Parameters
Type | Name | Description |
---|---|---|
PositiveDefiniteMatrix | sample | Constant value for |
Double | shape | Constant value for |
Wishart | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Wishart |
|
Remarks
The outgoing message is the factor viewed as a function of rate
conditioned on the given values.
RateAverageLogarithm(Wishart, Double, Wishart)
VMP message to rate
.
Declaration
public static Wishart RateAverageLogarithm(Wishart sample, double shape, Wishart result)
Parameters
Type | Name | Description |
---|---|---|
Wishart | sample | Incoming message from |
Double | shape | Constant value for |
Wishart | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Wishart |
|
Remarks
The outgoing message is the exponential of the average log-factor value, where the average is over all arguments except rate
. The formula is exp(sum_(sample) p(sample) log(factor(sample,shape,rate)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SampleAverageConditional(Double, PositiveDefiniteMatrix, Wishart)
EP message to sample
.
Declaration
public static Wishart SampleAverageConditional(double shape, PositiveDefiniteMatrix rate, Wishart result)
Parameters
Type | Name | Description |
---|---|---|
Double | shape | Constant value for |
PositiveDefiniteMatrix | rate | Constant value for |
Wishart | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Wishart |
|
Remarks
The outgoing message is the factor viewed as a function of sample
conditioned on the given values.
SampleAverageLogarithm(Double, Wishart, Wishart)
VMP message to sample
.
Declaration
public static Wishart SampleAverageLogarithm(double shape, Wishart rate, Wishart result)
Parameters
Type | Name | Description |
---|---|---|
Double | shape | Constant value for |
Wishart | rate | Incoming message from |
Wishart | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Wishart |
|
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_(rate) p(rate) log(factor(sample,shape,rate)))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SampleAverageLogarithm(Double, PositiveDefiniteMatrix, Wishart)
VMP message to sample
.
Declaration
public static Wishart SampleAverageLogarithm(double shape, PositiveDefiniteMatrix rate, Wishart result)
Parameters
Type | Name | Description |
---|---|---|
Double | shape | Constant value for |
PositiveDefiniteMatrix | rate | Constant value for |
Wishart | result | Modified to contain the outgoing message. |
Returns
Type | Description |
---|---|
Wishart |
|
Remarks
The outgoing message is the factor viewed as a function of sample
conditioned on the given values.