Class DistributionArray2D<T, DomainType>
A distribution over an array of type DomainType
, where each element is independent and has distribution of type T
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Serializable]
[Quality(QualityBand.Mature)]
[DataContract]
public abstract class DistributionArray2D<T, DomainType> : DistributionArray2D<T>, CanSetAllElementsTo<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IArray2D<T>, IArray<T>, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, SettableTo<T[, ]>, SettableTo<Array2D<T>>, ConvertibleToArray, IDistribution<DomainType[, ]>, IDistribution, ICloneable, Diffable, SettableToUniform, HasPoint<DomainType[, ]>, CanGetLogProb<DomainType[, ]>, Sampleable<DomainType[, ]> where T : SettableToUniform, Diffable, Sampleable<DomainType>, IDistribution<DomainType>
Type Parameters
Name | Description |
---|---|
T | Distribution type of an element. Must be a value type all the way down, i.e. must not hold any references. |
DomainType | Domain type of an element |
Remarks
This is an extension of DistributionArray that implements IDistribution and Sampleable.
Constructors
DistributionArray2D()
Parameterless constructor needed for serialization
Declaration
protected DistributionArray2D()
DistributionArray2D(T[,])
Constructs a new 2-D distribution array given a 2-D array of distributions
Declaration
public DistributionArray2D(T[, ] array)
Parameters
Type | Name | Description |
---|---|---|
T[,] | array |
DistributionArray2D(Array2D<T>)
Copy constructor.
Declaration
public DistributionArray2D(Array2D<T> that)
Parameters
Type | Name | Description |
---|---|---|
Array2D<T> | that |
DistributionArray2D(Int32, Int32)
Constructs a new 2-D distribution array given the lengths of each dimension
Declaration
public DistributionArray2D(int length0, int length1)
Parameters
Type | Name | Description |
---|---|---|
Int32 | length0 | |
Int32 | length1 |
DistributionArray2D(Int32, Int32, T[])
Constructs a new 2-D distribution array given the lengths of each dimension, and an array of values to reference
Declaration
public DistributionArray2D(int length0, int length1, T[] valuesRef)
Parameters
Type | Name | Description |
---|---|---|
Int32 | length0 | |
Int32 | length1 | |
T[] | valuesRef | Array of values to reference |
Properties
IsPointMass
True if the distribution is a point mass
Declaration
[IgnoreDataMember]
public bool IsPointMass { get; }
Property Value
Type | Description |
---|---|
Boolean |
Point
Sets/gets the 2-D distribution array as a point mass
Declaration
[IgnoreDataMember]
public DomainType[, ] Point { get; set; }
Property Value
Type | Description |
---|---|
DomainType[,] |
Methods
GetLogProb(DomainType[,])
Gets the log probability density at a point
Declaration
public double GetLogProb(DomainType[, ] value)
Parameters
Type | Name | Description |
---|---|---|
DomainType[,] | value |
Returns
Type | Description |
---|---|
Double |
Sample()
Sample from the distribution
Declaration
public DomainType[, ] Sample()
Returns
Type | Description |
---|---|
DomainType[,] | A sample |
Sample(DomainType[,])
Sample from the distribution
Declaration
public abstract DomainType[, ] Sample(DomainType[, ] result)
Parameters
Type | Name | Description |
---|---|---|
DomainType[,] | result | Where to put the results |
Returns
Type | Description |
---|---|
DomainType[,] | A sample |