Struct NonconjugateGaussian
Nonconjugate Gaussian messages for VMP. The mean has a Gaussian distribution and the variance a Gamma distribution.
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Serializable]
[DataContract]
[Quality(QualityBand.Experimental)]
public struct NonconjugateGaussian : IDistribution<double>, IDistribution, ICloneable, SettableToUniform, HasPoint<double>, CanGetLogProb<double>, SettableTo<Gaussian>, SettableTo<NonconjugateGaussian>, SettableToRatio<NonconjugateGaussian>, SettableToRatio<NonconjugateGaussian, NonconjugateGaussian>, SettableToPower<NonconjugateGaussian>, SettableToProduct<NonconjugateGaussian>, SettableToProduct<NonconjugateGaussian, NonconjugateGaussian>, Sampleable<double>, SettableToWeightedSum<NonconjugateGaussian>, CanGetLogAverageOf<NonconjugateGaussian>, CanGetLogAverageOfPower<NonconjugateGaussian>, CanGetAverageLog<NonconjugateGaussian>, CanGetMeanAndVarianceOut<double, double>, Diffable
Constructors
NonconjugateGaussian(Gaussian)
Constructs a non-conjugate Gaussian from a Gaussian
Declaration
public NonconjugateGaussian(Gaussian that)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | that |
NonconjugateGaussian(NonconjugateGaussian)
Copy constructor
Declaration
public NonconjugateGaussian(NonconjugateGaussian that)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | that |
NonconjugateGaussian(Double, Double, Double, Double)
Constructs a non-conjugate Gaussian distribution its parameters
Declaration
[Construction(new string[]{"MeanTimesPrecision", "Precision", "Shape", "Rate"})]
public NonconjugateGaussian(double meanTimesPrecision, double precision, double shape, double rate)
Parameters
Type | Name | Description |
---|---|---|
Double | meanTimesPrecision | Mean times precision for the mean |
Double | precision | Precision for the mean |
Double | shape | Shape parameter for the variance |
Double | rate | Rate parameter for the variance |
Fields
MeanTimesPrecision
Mean times precision for the mean
Declaration
[DataMember]
public double MeanTimesPrecision
Field Value
Type | Description |
---|---|
Double |
Precision
Precision for the mean
Declaration
[DataMember]
public double Precision
Field Value
Type | Description |
---|---|
Double |
Rate
Rate parameter for the variance
Declaration
[DataMember]
public double Rate
Field Value
Type | Description |
---|---|
Double |
Shape
Shape parameter for the variance
Declaration
[DataMember]
public double Shape
Field Value
Type | Description |
---|---|
Double |
Methods
GetAverageLog(NonconjugateGaussian)
Declaration
public double GetAverageLog(NonconjugateGaussian that)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | that |
Returns
Type | Description |
---|---|
Double |
GetGaussian()
Convert to the optimal Gaussian
Declaration
public Gaussian GetGaussian()
Returns
Type | Description |
---|---|
Gaussian |
GetGaussian(Boolean)
Convert to the optimal Gaussian
Declaration
public Gaussian GetGaussian(bool addEntropy)
Parameters
Type | Name | Description |
---|---|---|
Boolean | addEntropy | Whether to include an entropy term |
Returns
Type | Description |
---|---|
Gaussian |
GetLogAverageOf(NonconjugateGaussian)
Declaration
public double GetLogAverageOf(NonconjugateGaussian that)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | that |
Returns
Type | Description |
---|---|
Double |
GetLogAverageOfPower(NonconjugateGaussian, Double)
Declaration
public double GetLogAverageOfPower(NonconjugateGaussian that, double power)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | that | |
Double | power |
Returns
Type | Description |
---|---|
Double |
GetMeanAndVariance(out Double, out Double)
Gets the mean and variance of this distribution
Declaration
public void GetMeanAndVariance(out double mean, out double variance)
Parameters
Type | Name | Description |
---|---|---|
Double | mean | Output mean |
Double | variance | Output variance |
IsProper()
Returns true if the distribution is proper
Declaration
public bool IsProper()
Returns
Type | Description |
---|---|
Boolean |
IsUniform()
Returns true if distribution is uniform
Declaration
public bool IsUniform()
Returns
Type | Description |
---|---|
Boolean |
MaxDiff(Object)
The maximum difference between the parameters of this distribution and that
Declaration
public double MaxDiff(object thatd)
Parameters
Type | Name | Description |
---|---|---|
Object | thatd |
Returns
Type | Description |
---|---|
Double |
SetTo(Gaussian)
Sets this non-congugate Gaussian to a Gaussian
Declaration
public void SetTo(Gaussian value)
Parameters
Type | Name | Description |
---|---|---|
Gaussian | value |
SetTo(NonconjugateGaussian)
Sets this non-conjugate Gaussian to another non-conjugate Gaussian
Declaration
public void SetTo(NonconjugateGaussian value)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | value |
SetToPower(NonconjugateGaussian, Double)
Sets this non-conjugate Gaussian distribution to the power of another.
Declaration
public void SetToPower(NonconjugateGaussian value, double exponent)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | value | The |
Double | exponent |
SetToProduct(NonconjugateGaussian, NonconjugateGaussian)
Sets this non-conjugate Gaussian distribution to the product of two others.
Declaration
public void SetToProduct(NonconjugateGaussian a, NonconjugateGaussian b)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | a | |
NonconjugateGaussian | b |
SetToRatio(NonconjugateGaussian, NonconjugateGaussian, Boolean)
Sets this non-conjugate Gaussian distribution to the ratio of two others.
Declaration
public void SetToRatio(NonconjugateGaussian numerator, NonconjugateGaussian denominator, bool forceProper = false)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | numerator | Numerator |
NonconjugateGaussian | denominator | Denominator |
Boolean | forceProper | Ignored |
SetToSum(Double, NonconjugateGaussian, Double, NonconjugateGaussian)
Declaration
public void SetToSum(double weight1, NonconjugateGaussian value1, double weight2, NonconjugateGaussian value2)
Parameters
Type | Name | Description |
---|---|---|
Double | weight1 | |
NonconjugateGaussian | value1 | |
Double | weight2 | |
NonconjugateGaussian | value2 |
SetToUniform()
Sets this to a uniform distribution
Declaration
public void SetToUniform()
ToString()
Print details as as string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Uniform()
Create a uniform non-conjugate Gaussian distribution
Declaration
[Construction(UseWhen = "IsUniform")]
public static NonconjugateGaussian Uniform()
Returns
Type | Description |
---|---|
NonconjugateGaussian |
Operators
Multiply(NonconjugateGaussian, NonconjugateGaussian)
Product operator
Declaration
public static NonconjugateGaussian operator *(NonconjugateGaussian a, NonconjugateGaussian b)
Parameters
Type | Name | Description |
---|---|---|
NonconjugateGaussian | a | |
NonconjugateGaussian | b |
Returns
Type | Description |
---|---|
NonconjugateGaussian |
Explicit Interface Implementations
CanGetLogProb<Double>.GetLogProb(Double)
Gets the log probability of the given value
Declaration
double CanGetLogProb<double>.GetLogProb(double value)
Parameters
Type | Name | Description |
---|---|---|
Double | value |
Returns
Type | Description |
---|---|
Double | Not yet implemented |
HasPoint<Double>.IsPointMass
Declaration
readonly bool HasPoint<double>.IsPointMass { get; }
Returns
Type | Description |
---|---|
Boolean |
HasPoint<Double>.Point
Declaration
double HasPoint<double>.Point { get; set; }
Returns
Type | Description |
---|---|
Double |
Sampleable<Double>.Sample()
Samples from a non-conjugate Gaussian distribution
Declaration
double Sampleable<double>.Sample()
Returns
Type | Description |
---|---|
Double | Not yet implemented |
Sampleable<Double>.Sample(Double)
Samples from a non-conjugate Gaussian distribution
Declaration
double Sampleable<double>.Sample(double result)
Parameters
Type | Name | Description |
---|---|---|
Double | result | Where to put the result |
Returns
Type | Description |
---|---|
Double |
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
Object |