Class SparseBetaList
Represents a sparse list of Beta distributions, optimized for the case where many share the same parameter value. The class supports an approximation tolerance which allows elements close to the common value to be automatically reset to the common value.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Serializable]
[Quality(QualityBand.Stable)]
[DataContract]
public class SparseBetaList : SparseDistributionList<Beta, double, SparseBetaList>, ISparseList<Beta>, ISparseEnumerable<Beta>, IList<Beta>, ICollection<Beta>, IEnumerable<Beta>, IList, ICollection, IEnumerable, IDistribution<ISparseList<double>>, IDistribution, ICloneable, Diffable, SettableToUniform, HasPoint<ISparseList<double>>, CanGetLogProb<ISparseList<double>>, Sampleable<ISparseList<double>>, SettableTo<SparseBetaList>, SettableToProduct<SparseBetaList>, SettableToProduct<SparseBetaList, SparseBetaList>, SettableToPower<SparseBetaList>, SettableToRatio<SparseBetaList>, SettableToRatio<SparseBetaList, SparseBetaList>, SettableToWeightedSum<SparseBetaList>, CanGetLogAverageOf<SparseBetaList>, CanGetLogAverageOfPower<SparseBetaList>, CanGetAverageLog<SparseBetaList>, CanGetMean<ISparseList<double>>, CanGetVariance<ISparseList<double>>
Constructors
SparseBetaList()
Initializes a new instance of the SparseBetaList class.
Declaration
public SparseBetaList()
Methods
FromCounts(ISparseList<Double>, ISparseList<Double>)
Returns a new instance of the SparseBetaList class from sparse lists of true and false counts.
Declaration
public static SparseBetaList FromCounts(ISparseList<double> trueCounts, ISparseList<double> falseCounts)
Parameters
| Type | Name | Description |
|---|---|---|
| ISparseList<Double> | trueCounts | The true counts. |
| ISparseList<Double> | falseCounts | The false counts. |
Returns
| Type | Description |
|---|---|
| SparseBetaList | A new instance of the SparseBetaList class. |
FromCounts(ISparseList<Double>, ISparseList<Double>, Double)
Returns a new instance of instance of the SparseBetaList class from sparse lists of true and false counts.
Declaration
public static SparseBetaList FromCounts(ISparseList<double> trueCounts, ISparseList<double> falseCounts, double tolerance)
Parameters
| Type | Name | Description |
|---|---|---|
| ISparseList<Double> | trueCounts | The true counts. |
| ISparseList<Double> | falseCounts | The false counts. |
| Double | tolerance | The tolerance for the approximation. |
Returns
| Type | Description |
|---|---|
| SparseBetaList | A new instance of the SparseBetaList class. |
FromCounts(Int32, Double, Double)
Returns a new instance of the SparseBetaList class of a given size, with each element having given true and false counts.
Declaration
public static SparseBetaList FromCounts(int size, double trueCount, double falseCount)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | size | The size of the list. |
| Double | trueCount | The true count. |
| Double | falseCount | The false count. |
Returns
| Type | Description |
|---|---|
| SparseBetaList | A new instance of the SparseBetaList class. |
FromCounts(Int32, Double, Double, Double)
Returns a new instance of the SparseBetaList class of a given size, with each element having given true and false counts.
Declaration
public static SparseBetaList FromCounts(int size, double trueCount, double falseCount, double tolerance)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | size | The size of the list. |
| Double | trueCount | The true count. |
| Double | falseCount | The false count. |
| Double | tolerance | The tolerance for the approximation. |
Returns
| Type | Description |
|---|---|
| SparseBetaList | A new instance of the SparseBetaList class. |
Sample(ISparseList<Double>, ISparseList<Double>)
Samples from a SparseBetaList with the specified sparse lists of true counts and false counts.
Declaration
public static ISparseList<double> Sample(ISparseList<double> trueCounts, ISparseList<double> falseCounts)
Parameters
| Type | Name | Description |
|---|---|---|
| ISparseList<Double> | trueCounts | The true counts. |
| ISparseList<Double> | falseCounts | The false counts. |
Returns
| Type | Description |
|---|---|
| ISparseList<Double> | The sample. |
Operators
Division(SparseBetaList, SparseBetaList)
Creates a SparseBetaList distribution which is the ratio of two others
Declaration
public static SparseBetaList operator /(SparseBetaList numerator, SparseBetaList denominator)
Parameters
| Type | Name | Description |
|---|---|---|
| SparseBetaList | numerator | The numerator. |
| SparseBetaList | denominator | The denominator. |
Returns
| Type | Description |
|---|---|
| SparseBetaList | The resulting SparseBetaList distribution. |
ExclusiveOr(SparseBetaList, Double)
Creates a SparseBetaList distribution which is the power of another.
Declaration
public static SparseBetaList operator ^(SparseBetaList dist, double exponent)
Parameters
| Type | Name | Description |
|---|---|---|
| SparseBetaList | dist | The other distribution. |
| Double | exponent | The exponent. |
Returns
| Type | Description |
|---|---|
| SparseBetaList | The resulting SparseBetaList distribution. |
Multiply(SparseBetaList, SparseBetaList)
Creates a SparseBetaList distribution which is the product of two others
Declaration
public static SparseBetaList operator *(SparseBetaList a, SparseBetaList b)
Parameters
| Type | Name | Description |
|---|---|---|
| SparseBetaList | a | The first distribution. |
| SparseBetaList | b | The second distribution. |
Returns
| Type | Description |
|---|---|
| SparseBetaList | The resulting SparseBetaList distribution. |