Click or drag to resize
Beta Structure
Microsoft Research
A Beta distribution over the interval [0,1].

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

The Beta type exposes the following members.

Constructors
  NameDescription
Public methodBeta(Beta)
Copy constructor.
Public methodBeta(Double, Double)
Creates a Beta distribution with the given parameters.
Top
Methods
  NameDescription
Public methodStatic memberBetaLn
Computes the log Beta function: GammaLn(trueCount)+GammaLn(falseCount)-GammaLn(trueCount+falseCount).
Public methodClone
Clones this Beta.
Public methodStatic memberFromMeanAndVariance
Creates a new Beta distribution from a specified mean and variance
Public methodStatic memberFromMeanLogs
Constructs a Beta distribution with the given E[log(p)] and E[log(1-p)].
Public methodGetAverageLog
The expected logarithm of that distribution under this distribution.
Public methodGetLogAverageOf
The log of the integral of the product of this Beta and that Beta
Public methodGetLogAverageOfPower
Get the integral of this distribution times another distribution raised to a power.
Public methodGetLogNormalizer
Gets the log normalizer for the distribution
Public methodGetLogProb
Evaluates the logarithm of the density function
Public methodGetMean
The expected value E[p].
Public methodGetMeanAndVariance
Gets the mean and variance for this instance
Public methodGetMeanCube
The expected cube E[p^3].
Public methodGetMeanLog
The expected logarithm E[log(p)].
Public methodGetMeanLogs
The expected logarithms E[log(p)] and E[log(1-p)].
Public methodGetMeanSquare
The expected square E[p^2].
Public methodGetMode
The most probable value.
Public methodGetProbLessThan
Compute the probability that a sample from this distribution is less than x.
Public methodGetVariance
The variance var(p).
Public methodIsProper
Whether the distribution is proper or not. It is improper when trueCount <= 0 or falseCount <= 0 in which case it cannot be normalised
Public methodIsUniform
Whether the distribution is uniform
Public methodMaxDiff
The maximum 'difference' between the parameters of this instance and of that instance.
Public methodStatic memberPointMass
Instantiates a point-mass Beta distribution
Public methodSample
Sample from this Beta distribution
Public methodSample(Double)
Public methodStatic memberSample(Double, Double)
Static method to sample from a Beta distribution with the specified true and false counts
Public methodStatic memberSampleFromMeanAndVariance
Static method to sample from a Beta distribution with the specified mean and variance
Public methodSetMeanAndVariance
Sets the mean and variance for this instance
Public methodSetTo
Sets the parameters of this instance to the parameters of that instance
Public methodSetToPower
Sets the parameters to represent the a Beta raised to some power.
Public methodSetToProduct
Sets the parameters to represent the product of two Betas.
Public methodSetToRatio
Sets the parameters to represent the ratio of two Betas.
Public methodSetToSum
Set the parameters to match the moments of a mixture distribution.
Public methodSetToUniform
Sets this instance to be uniform
Public methodStatic memberUniform
Instantiates a uniform Beta distribution
Top
Operators
  NameDescription
Public operatorStatic memberDivision
Static ratio operator. Create a Beta distribution which is the ratio of two Beta distributions
Public operatorStatic memberEquality
Equals operator
Public operatorStatic memberExclusiveOr
Raises a distribution to a power.
Public operatorStatic memberInequality
Not Equals operator
Public operatorStatic memberMultiply
Static product operator. Create a Beta distribution which is the product of two Beta distributions
Top
Fields
  NameDescription
Public fieldStatic memberAllowImproperSum
Property to allow an improper sum
Public fieldFalseCount
False count
Public fieldTrueCount
True count
Top
Properties
  NameDescription
Public propertyIsPointMass
Whether the instance is a point mass beta distribution
Public propertyPoint
Gets/sets the instance as a point mass
Public propertyTotalCount
The sum of TrueCount and FalseCount.
Top
Remarks

The Beta is often used as a distribution on probability values. The formula for the distribution is p(x) = (Gamma(trueCount+falseCount)/Gamma(trueCount)/Gamma(falseCount)) x^{trueCount-1} (1-x)^(falseCount-1) subject to the constraint 0 <= x <= 1.

If trueCount = falseCount = 1, the distribution is uniform. If falseCount = infinity, the distribution is redefined to be a point mass on trueCount. When trueCount <= 0 or falseCount <= 0, the distribution is improper. In this case, the density is redefined to not include the Gamma terms, i.e. there is no normalizer.

See Also