Class DistributionArray<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 DistributionArray<T, DomainType> : DistributionArray<T>, IArray<T>, IList<T>, ICollection<T>, CanSetAllElementsTo<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, SettableTo<T[]>, SettableTo<Array<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
DistributionArray()
Parameterless constructor needed for serialization
Declaration
protected DistributionArray()
DistributionArray(T[])
Creates a distribution array from an array of distributions
Declaration
public DistributionArray(T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array |
DistributionArray(Array<T>)
Copy constructor
Declaration
public DistributionArray(Array<T> that)
Parameters
Type | Name | Description |
---|---|---|
Array<T> | that |
DistributionArray(Int32)
Creates a distribution array of a specified length
Declaration
public DistributionArray(int length)
Parameters
Type | Name | Description |
---|---|---|
Int32 | length |
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 instance as a point mass
Declaration
[IgnoreDataMember]
public DomainType[] Point { get; set; }
Property Value
Type | Description |
---|---|
DomainType[] |
Methods
GetLogProb(DomainType[])
Logarithm of the probability density function
Declaration
public double GetLogProb(DomainType[] value)
Parameters
Type | Name | Description |
---|---|---|
DomainType[] | value |
Returns
Type | Description |
---|---|
Double |
Sample()
Get a sample from the distribution array
Declaration
public DomainType[] Sample()
Returns
Type | Description |
---|---|
DomainType[] | An array of samples |
Sample(DomainType[])
Get a sample from the distribution array
Declaration
public abstract DomainType[] Sample(DomainType[] result)
Parameters
Type | Name | Description |
---|---|---|
DomainType[] | result | Where to put the results |
Returns
Type | Description |
---|---|
DomainType[] | An array of samples |