Class GibbsMarginal<TDist, T>
Gibbs marginal - wraps underlying estimator, provides burn-in and thinning, and maintains thinned samples and conditionals
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Quality(QualityBand.Preview)]
public class GibbsMarginal<TDist, T> : IsDistributionWrapper, Estimator<TDist> where TDist : IDistribution<T>, Sampleable<T>
Type Parameters
Name | Description |
---|---|
TDist | The distribution type |
T | The domain type |
Constructors
GibbsMarginal(TDist, Int32, Int32, Boolean, Boolean, Boolean)
Constructor from a distribution prototype, and burn in and thin parameters
Declaration
public GibbsMarginal(TDist distPrototype, int burnIn, int thin, bool estimateMarginal, bool collectSamples, bool collectDistributions)
Parameters
Type | Name | Description |
---|---|---|
TDist | distPrototype | Prototype distribution |
Int32 | burnIn | Burn in - number of sample discarded initially |
Int32 | thin | Thinning parameter - only every 'thin' samples returned |
Boolean | estimateMarginal | |
Boolean | collectSamples | |
Boolean | collectDistributions |
GibbsMarginal(GibbsMarginal<TDist, T>)
Copy constructor.
Declaration
public GibbsMarginal(GibbsMarginal<TDist, T> that)
Parameters
Type | Name | Description |
---|---|---|
GibbsMarginal<TDist, T> | that |
Remarks
This does a soft copy of the estimator and sample and conditional lists
Fields
LastConditional
Last conditional distribution added. If no conditionals, returns uniform
Declaration
public TDist LastConditional
Field Value
Type | Description |
---|---|
TDist |
LastSample
Last sample added. If no samples, returns default(T)
Declaration
public T LastSample
Field Value
Type | Description |
---|---|
T |
Properties
Conditionals
Thinned conditionals
Declaration
public IList<TDist> Conditionals { get; }
Property Value
Type | Description |
---|---|
IList<TDist> |
Distribution
The marginal
Declaration
public TDist Distribution { get; }
Property Value
Type | Description |
---|---|
TDist |
Estimator
The embedded estimator
Declaration
public Estimator<TDist> Estimator { get; }
Property Value
Type | Description |
---|---|
Estimator<TDist> |
Samples
Thinned samples
Declaration
public IList<T> Samples { get; }
Property Value
Type | Description |
---|---|
IList<T> |
Methods
Clear()
Clears out all the samples and clears the accumulators
Declaration
public void Clear()
GetDistribution(TDist)
Get the estimated distribution from the samples
Declaration
public TDist GetDistribution(TDist result)
Parameters
Type | Name | Description |
---|---|---|
TDist | result |
Returns
Type | Description |
---|---|
TDist |
PostUpdate()
Perform an update by adding a sample from the last conditional
Declaration
public void PostUpdate()
ToString()
Shows the GibbsMarginal in string form
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |