Class GammaFromShapeAndRateOp_Slow
Provides outgoing messages for GammaFromShapeAndRate(Double, Double), given random arguments to the function.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Factors
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[FactorMethod(typeof(Factor), "GammaFromShapeAndRate", new Type[]{}, Default = true)]
[Quality(QualityBand.Stable)]
public class GammaFromShapeAndRateOp_Slow : GammaFromShapeAndRateOpBase
Fields
QuadratureNodeCount
Declaration
public static int QuadratureNodeCount
Field Value
Type | Description |
---|---|
Int32 |
Methods
LogAverageFactor(Gamma, Double, Gamma)
Evidence message for EP.
Declaration
public static double LogAverageFactor(Gamma sample, double shape, Gamma rate)
Parameters
Type | Name | Description |
---|---|---|
Gamma | sample | Incoming message from |
Double | shape | Constant value for |
Gamma | 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_(sample,rate) p(sample,rate) factor(sample,shape,rate))
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
LogEvidenceRatio(Gamma, Double, Gamma, Gamma)
Evidence message for EP.
Declaration
public static double LogEvidenceRatio(Gamma sample, double shape, Gamma rate, Gamma to_sample)
Parameters
Type | Name | Description |
---|---|---|
Gamma | sample | Incoming message from |
Double | shape | Constant value for |
Gamma | rate | Incoming message from |
Gamma | to_sample | Previous outgoing message to |
Returns
Type | Description |
---|---|
Double | Logarithm of the factor's contribution the EP model evidence. |
Remarks
The formula for the result is log(sum_(sample,rate) p(sample,rate) 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.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
ImproperMessageException |
|
RateAverageConditional(Gamma, Double, Gamma)
EP message to rate
.
Declaration
public static Gamma RateAverageConditional(Gamma sample, double shape, Gamma rate)
Parameters
Type | Name | Description |
---|---|---|
Gamma | sample | Incoming message from |
Double | shape | Constant value for |
Gamma | rate | Incoming message from |
Returns
Type | Description |
---|---|
Gamma | The outgoing EP message to the |
Remarks
The outgoing message is a distribution matching the moments of rate
as the random arguments are varied. The formula is proj[p(rate) sum_(sample) p(sample) factor(sample,shape,rate)]/p(rate)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|
SampleAverageConditional(Gamma, Double, Gamma)
EP message to sample
.
Declaration
public static Gamma SampleAverageConditional(Gamma sample, double shape, Gamma rate)
Parameters
Type | Name | Description |
---|---|---|
Gamma | sample | Incoming message from |
Double | shape | Constant value for |
Gamma | rate | Incoming message from |
Returns
Type | Description |
---|---|
Gamma | 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_(rate) p(rate) factor(sample,shape,rate)]/p(sample)
.
Exceptions
Type | Condition |
---|---|
ImproperMessageException |
|