Click or drag to resize
Gaussian Structure
Microsoft Research
Represents a one-dimensional Gaussian distribution.

Namespace: MicrosoftResearch.Infer.Distributions
Assembly: Infer.Runtime (in Infer.Runtime.dll) Version: 2.6.41127.1 (2.6.41127.1)
Syntax
[SerializableAttribute]
[Quality(QualityBand.Mature)]
public struct Gaussian : IDistribution<double>, 
	ICloneable, HasPoint<double>, CanGetLogProb<double>, 
	SettableTo<Gaussian>, SettableToProduct<Gaussian>, SettableToProduct<Gaussian, Gaussian>, 
	Diffable, SettableToUniform, SettableToRatio<Gaussian>, SettableToRatio<Gaussian, Gaussian>, 
	SettableToPower<Gaussian>, SettableToWeightedSum<Gaussian>, Sampleable<double>, 
	CanGetMean<double>, CanGetVariance<double>, CanGetMeanAndVarianceOut<double, double>, 
	CanSetMeanAndVariance<double, double>, CanGetLogAverageOf<Gaussian>, 
	CanGetLogAverageOfPower<Gaussian>, CanGetAverageLog<Gaussian>, CanGetLogNormalizer, 
	CanGetMode<double>

The Gaussian type exposes the following members.

Constructors
  NameDescription
Public methodGaussian(Gaussian)
Copy constructor.
Public methodGaussian(Double, Double)
Creates a Gaussian distribution with specified mean and variance.
Top
Methods
  NameDescription
Public methodClone
Clones this Gaussian.
Public methodStatic memberFromDerivatives
Construct a Gaussian distribution whose pdf has the given derivatives at a point.
Public methodStatic memberFromMeanAndPrecision
Creates a Gaussian distribution with given mean and precision.
Public methodStatic memberFromMeanAndVariance
Creates a Gaussian distribution with given mean and variance.
Public methodStatic memberFromNatural
Creates a new Gaussian distribution from its natural parameters (Mean times precision, and Precision)
Public methodGetAverageLog
Gets the expected logarithm of that distribution under this distribution.
Public methodGetLogAverageOf
Gets the integral of the product of two Gaussians.
Public methodGetLogAverageOfPower
Get the integral of this distribution times another distribution raised to a power.
Public methodGetLogNormalizer
Gets the log of the normalizer for the Gaussian density function
Public methodGetLogProb(Double)
Evaluates the log of this one-dimensional Gaussian density.
Public methodStatic memberGetLogProb(Double, Double, Double)
Evaluates the log of one-dimensional Gaussian density.
Public methodGetMean
Gets the expected value E(x)
Public methodGetMeanAndPrecision
Gets the mean and precision
Public methodGetMeanAndVariance
Gets the mean and variance
Public methodGetMode
The most probable value
Public methodGetNatural
Gets the natural parameters of the distribution (mean time precision, and precision)
Public methodGetVariance
Gets the variance
Public methodIsProper
Asks whether this Gaussian instance is proper or not. A Gaussian distribution is proper only if Precision > 0.
Public methodIsUniform
Asks whether this instance is uniform
Public methodMaxDiff
The maximum difference between the parameters of this Gaussian and that Gaussian
Public methodStatic memberPointMass
Create a new point mass Gaussian distribution at a specified location
Public methodSample
Samples from this Gaussian distribution
Public methodSample(Double)
Samples from this Gaussian distribution. This override is only present to support the Sampleable interface
Public methodStatic memberSample(Double, Double)
Samples from a Gaussian distribution with the specified mean and precision
Public methodSetMeanAndPrecision
Sets the mean and precision
Public methodSetMeanAndVariance
Sets the mean and variance
Public methodSetNatural
Sets the natural parameters of the distribution (mean time precision, and precision)
Public methodSetTo
Sets this Gaussian instance to have the parameter values of that Gaussian instance
Public methodSetToPower
Sets the parameters to represent the power of a source Gaussian to some exponent.
Public methodSetToProduct
Sets the parameters to represent the product of two Gaussians.
Public methodSetToRatio
Sets the parameters to represent the ratio of two Gaussians, optionally forcing the precision to be non-negative.
Public methodSetToSum
Sets the mean and variance to match a Gaussian mixture.
Public methodSetToUniform
Sets this Gaussian instance to be a uniform distribution
Public methodStatic memberUniform
Creates a new uniform Gaussian distribution
Public methodStatic memberWeightedSumT
Creates a distribution of the specified type which matches the mean and variance of a Gaussian mixture. The distribution type must implement CanGetMeanAndVarianceOutMeanType, VarType,
Top
Operators
  NameDescription
Public operatorStatic memberDivision
Creates a new Gaussian which is the ratio of two other Gaussians
Public operatorStatic memberEquality
Equals operator
Public operatorStatic memberExclusiveOr
Raises a distribution to a power.
Public operatorStatic memberInequality
Not equals operator
Public operatorStatic memberMultiply
Creates a new Gaussian which is the product of two other Gaussians
Top
Fields
  NameDescription
Public fieldMeanTimesPrecision
Mean times precision
Public fieldPrecision
Precision
Top
Properties
  NameDescription
Public propertyIsPointMass
Asks whether the instance is a point mass
Public propertyPoint
Sets/gets the instance as a point mass
Top
Remarks

The distribution is represented by two parameters: MeanTimesPrecision and Precision. Precision is the inverse of the variance, so a Gaussian with mean m and variance v is represented as Precision = 1/v, MeanTimesPrecision = m/v.

Some special cases: If the Precision is zero, then the distribution is uniform. If the Precision is infinite, then the distribution is a point mass. The Point property gives the location of the point mass.

The formula for the distribution is: N(x;m,v) = 1/sqrt(2*pi*v) * exp(-(x-m)^2/(2v)). When v=0, this reduces to delta(x-m). When v=infinity, the density is redefined to be 1. When v < 0, the density is redefined to be exp(-0.5*x^2*(1/v) + x*(m/v)), i.e. we drop the terms exp(-m^2/(2v))/sqrt(2*pi*v).

See Also