Click or drag to resize
Wishart Class
Microsoft Research
A Wishart distribution on positive definite matrices.
Inheritance Hierarchy
SystemObject
  MicrosoftResearch.Infer.DistributionsWishart

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 class Wishart : IDistribution<PositiveDefiniteMatrix>, 
	ICloneable, HasPoint<PositiveDefiniteMatrix>, CanGetLogProb<PositiveDefiniteMatrix>, 
	SettableTo<Wishart>, SettableToProduct<Wishart>, SettableToProduct<Wishart, Wishart>, 
	Diffable, SettableToUniform, Sampleable<PositiveDefiniteMatrix>, SettableToRatio<Wishart>, 
	SettableToRatio<Wishart, Wishart>, SettableToPower<Wishart>, 
	CanGetMean<PositiveDefiniteMatrix>, CanGetVariance<PositiveDefiniteMatrix>, CanGetMeanAndVariance<PositiveDefiniteMatrix, PositiveDefiniteMatrix>, 
	CanSetMeanAndVariance<PositiveDefiniteMatrix, PositiveDefiniteMatrix>, CanGetLogAverageOf<Wishart>, 
	CanGetLogAverageOfPower<Wishart>, SettableToWeightedSum<Wishart>, CanGetAverageLog<Wishart>, 
	CanGetLogNormalizer, CanGetMode<PositiveDefiniteMatrix>

The Wishart type exposes the following members.

Constructors
  NameDescription
Public methodWishart(Int32)
Constructs a uniform Wishart distribution of the given dimension
Public methodWishart(Double, PositiveDefiniteMatrix)
Constructs a multi-dimensional Wishart with given shape and scale matrix
Public methodWishart(Double, Double)
Creates a one-dimensional Wishart with given shape and scale
Public methodWishart(Int32, Double, Double)
Constructs a multi-dimensional Wishart with given shape and with a scale matrix which is set to a scaled identity matrix
Top
Methods
  NameDescription
Public methodClone
Clones this Wishart.
Public methodStatic memberFromMeanAndMeanLogDeterminant
Constructs a Wishart distribution with the given mean and mean log determinant.
Public methodStatic memberFromShapeAndRate(Double, PositiveDefiniteMatrix)
Creates a multi-dimensional Wishart with given shape and rate matrix
Public methodStatic memberFromShapeAndRate(Int32, Double, Double)
Creates a multi-dimensional Wishart with given shape and with a rate matrix which is set to a scaled identity matrix
Public methodStatic memberFromShapeAndScale(Double, PositiveDefiniteMatrix)
Creates a new multi-dimensional Wishart with given shape and scale matrix
Public methodStatic memberFromShapeAndScale(Int32, Double, Double)
Creates a multi-dimensional Wishart with given shape and with a scale matrix which is set to a scaled identity matrix
Public methodGetAverageLog
The expected logarithm of that distribution under this distribution.
Public methodGetLogAverageOf
Gets the log-integral of the product of this Wishart with another Wishart
Public methodGetLogAverageOfPower
Get the integral of this distribution times another distribution raised to a power.
Public methodGetLogNormalizer
Gets the normalizer for the density function of this Wishart distribution
Public methodStatic memberGetLogNormalizer(Double, PositiveDefiniteMatrix)
Gets the normalizer for a Wishart density function specified by shape and rate matrix
Public methodGetLogProb(PositiveDefiniteMatrix)
Evaluates the logarithm of this Wishart density function at a given point
Public methodStatic memberGetLogProb(PositiveDefiniteMatrix, Double, PositiveDefiniteMatrix)
Evaluates the logarithm of a Wishart density function at a given point
Public methodGetMean
Gets the mean of the distribution.
Public methodGetMean(PositiveDefiniteMatrix)
Gets the mean of the distribution.
Public methodGetMeanAndVariance
Gets the mean and variance matrices.
Public methodGetMeanLogDeterminant
Gets the mean log determinant
Public methodGetMode
Public methodGetMode(PositiveDefiniteMatrix)
Public methodGetScale
Gets the scale matrix
Public methodGetVariance
Gets the variance of the distribution
Public methodGetVariance(PositiveDefiniteMatrix)
Gets the variance of the distribution
Public methodIsProper
Asks whether this instance is proper
Public methodStatic memberIsProper(Double, PositiveDefiniteMatrix)
Asks whether a Wishart distribution of the specified shape and rate is proper
Public methodIsUniform
Asks whether this instance is uniform
Public methodMaxDiff
The maximum difference between the parameters of this Wishart and that Wishart
Public methodStatic memberPointMass(Double)
Creates a Wishart point mass at the specified location
Public methodStatic memberPointMass(PositiveDefiniteMatrix)
Creates a Wishart point mass at the specified location
Public methodSample
Samples this Wishart distribution. Workspaces and sample matrix are allocated behind the scenes
Public methodSample(PositiveDefiniteMatrix)
Samples this Wishart distribution. Workspaces are allocated behind the scenes
Public methodStatic memberSample(Double, PositiveDefiniteMatrix, PositiveDefiniteMatrix)
Samples a Wishart distribution of specified shape and rate. Workspaces are allocated behind the scenes
Public methodSample(PositiveDefiniteMatrix, LowerTriangularMatrix, LowerTriangularMatrix, Matrix)
Samples this Wishart distribution
Public methodStatic memberSampleFromShapeAndRate(Double, PositiveDefiniteMatrix)
Samples a Wishart distribution of specified shape and rate. Workspaces are allocated behind the scenes
Public methodStatic memberSampleFromShapeAndRate(Double, PositiveDefiniteMatrix, PositiveDefiniteMatrix)
Samples a Wishart distribution of specified shape and rate. Workspaces are allocated behind the scenes
Public methodStatic memberSampleFromShapeAndScale
Samples a Wishart distribution of specified shape and scale. Workspaces are allocated behind the scenes
Public methodSetDerivatives
Modify the parameters so that the pdf has the given derivatives at a point.
Public methodSetMeanAndVariance
Sets the parameters to produce a given mean and variance.
Public methodSetShapeAndRate
Sets the shape parameter and the rate matrix parameter for this instance
Public methodSetShapeAndScale
Sets the shape parameter and the scale matrix parameter for this instance
Public methodSetTo
Sets this Wishart instance to have the parameter values of another Wishart instance
Public methodSetToPower
Sets the parameters to represent the power of a source Wishart to some exponent.
Public methodSetToProduct
Sets the parameters to represent the product of two Wisharts.
Public methodSetToRatio
Sets the parameters to represent the ratio of two Wisharts.
Public methodSetToSum
Weighted mixture distribution for two Wisharts
Public methodSetToUniform
Sets this instance to have uniform distribution
Public methodStatic memberUniform
Constructs a uniform Wishart distribution of the given dimension
Public methodStatic memberWeightedSumT
Top
Operators
  NameDescription
Public operatorStatic memberDivision
Creates a new Wishart which is the ratio of two other Wishart
Public operatorStatic memberExclusiveOr
Raises a distribution to a power.
Public operatorStatic memberMultiply
Creates a new Wishart which the product of two other Wisharts
Top
Properties
  NameDescription
Public propertyDimension
Dimension of this distribution
Public propertyIsPointMass
Asks whether the instance is a point mass
Public propertyPoint
Sets/gets this instance as a point-mass
Public propertyRate
Sets/gets the rate matrix
Public propertyShape
Sets/gets the shape value
Public propertySourceArray
Gets/sets the source array for the Wishart parameters. These are stored contiguously in the SourceArray as Rate matrix followed by shape
Top
Remarks

In the matrix case, the distribution is p(X) = |X|^(a-(d+1)/2)*exp(-tr(X*B))*|B|^a/Gamma_d(a). In this code, the a parameter is called the "Shape" and the B parameter is called the "Rate". The mean of the distribution is a/B and the diagonal variance is var(X_ii) = a*C_ii^2 where C=inv(B). The non-diagonal variances are var(X_ij) = a*0.5*(C_ij^2 + C_ii*C_jj) where C=inv(B).

The distribution is represented by a one-dimensional Vector for a and a PositiveDefiniteMatrix for B. Because both are Cursors, any Wishart instance can be used as a cursor.

See Also