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