Class WishartEstimator
Estimates a Wishart distribution from samples.
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public class WishartEstimator : Estimator<Wishart>, Accumulator<Wishart>, Accumulator<PositiveDefiniteMatrix>, SettableTo<WishartEstimator>, ICloneable
Remarks
The distribution is estimated via moment matching (not maximum-likelihood).
E[X] = (a+(d+1)/2)/B
var(X_ii) = (a+(d+1)/2)*diag(inv(B))^2
because X_ii ~ Gamma(a+(d+1)/2, 1/diag(inv(B))).
Therefore:
a = E[X_ii]^2/var(X_ii) - (d+1)/2
B = (a+(d+1)/2)/E[X]
Constructors
WishartEstimator(Int32)
Creates a new Wishart estimator
Declaration
public WishartEstimator(int dimension)
Parameters
Type | Name | Description |
---|---|---|
Int32 | dimension | The dimension of the Wishart distribution |
Fields
mva
Where to accumulate mean and variance matrices
Declaration
public MatrixMeanVarianceAccumulator mva
Field Value
Type | Description |
---|---|
MatrixMeanVarianceAccumulator |
Properties
Dimension
The dimension of the Wishart distribution
Declaration
public int Dimension { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Add(Wishart)
Adds a Wishart distribution item to the estimator
Declaration
public void Add(Wishart item)
Parameters
Type | Name | Description |
---|---|---|
Wishart | item | The distribution instance to add |
Add(Wishart, Double)
Declaration
public void Add(Wishart item, double weight)
Parameters
Type | Name | Description |
---|---|---|
Wishart | item | |
Double | weight |
Add(PositiveDefiniteMatrix)
Adds a sample to the estimator
Declaration
public void Add(PositiveDefiniteMatrix item)
Parameters
Type | Name | Description |
---|---|---|
PositiveDefiniteMatrix | item | The sample to add |
Add(PositiveDefiniteMatrix, Double)
Declaration
public void Add(PositiveDefiniteMatrix item, double weight)
Parameters
Type | Name | Description |
---|---|---|
PositiveDefiniteMatrix | item | |
Double | weight |
Clear()
Clears the estimator
Declaration
public void Clear()
Clone()
Returns a clone of this estimator.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object |
GetDistribution(Wishart)
Retrieves the Wishart estimator
Declaration
public Wishart GetDistribution(Wishart result)
Parameters
Type | Name | Description |
---|---|---|
Wishart | result | Where to put the result |
Returns
Type | Description |
---|---|
Wishart | The resulting distribution |
SetTo(WishartEstimator)
Sets the state of this estimator from the specified estimator.
Declaration
public void SetTo(WishartEstimator value)
Parameters
Type | Name | Description |
---|---|---|
WishartEstimator | value |