Class SparseGaussianList
Represents a sparse list of Gaussian 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 SparseGaussianList : SparseDistributionList<Gaussian, double, SparseGaussianList>, ISparseList<Gaussian>, ISparseEnumerable<Gaussian>, IList<Gaussian>, ICollection<Gaussian>, IEnumerable<Gaussian>, IList, ICollection, IEnumerable, IDistribution<ISparseList<double>>, IDistribution, ICloneable, Diffable, SettableToUniform, HasPoint<ISparseList<double>>, CanGetLogProb<ISparseList<double>>, Sampleable<ISparseList<double>>, SettableTo<SparseGaussianList>, SettableToProduct<SparseGaussianList>, SettableToProduct<SparseGaussianList, SparseGaussianList>, SettableToPower<SparseGaussianList>, SettableToRatio<SparseGaussianList>, SettableToRatio<SparseGaussianList, SparseGaussianList>, SettableToWeightedSum<SparseGaussianList>, CanGetLogAverageOf<SparseGaussianList>, CanGetLogAverageOfPower<SparseGaussianList>, CanGetAverageLog<SparseGaussianList>, CanGetMean<ISparseList<double>>, CanGetVariance<ISparseList<double>>
Constructors
SparseGaussianList()
Initializes a new instance of the SparseGaussianList class.
Declaration
public SparseGaussianList()
Methods
FromMeanAndPrecision(ISparseList<Double>, ISparseList<Double>)
Returns a new instance of the SparseGaussianList class from sparse mean and precision lists.
Declaration
public static SparseGaussianList FromMeanAndPrecision(ISparseList<double> mean, ISparseList<double> precision)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Double> | mean | The desired mean values. |
ISparseList<Double> | precision | The desired precision values. |
Returns
Type | Description |
---|---|
SparseGaussianList | The new SparseGaussianList instance. |
FromMeanAndPrecision(ISparseList<Double>, ISparseList<Double>, Double)
Returns a new instance of the SparseGaussianList class from sparse mean and precision lists.
Declaration
public static SparseGaussianList FromMeanAndPrecision(ISparseList<double> mean, ISparseList<double> precision, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Double> | mean | The desired mean. |
ISparseList<Double> | precision | The desired precision. |
Double | tolerance | The tolerance for the approximation. |
Returns
Type | Description |
---|---|
SparseGaussianList | The new SparseGaussianList instance. |
FromMeanAndPrecision(Int32, Double, Double)
Returns a new instance of the SparseGaussianList class of a given size, with each element having a given mean and precision.
Declaration
public static SparseGaussianList FromMeanAndPrecision(int size, double mean, double precision)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | The size of the list. |
Double | mean | The desired mean. |
Double | precision | The desired precision. |
Returns
Type | Description |
---|---|
SparseGaussianList | The new SparseGaussianList instance. |
FromMeanAndPrecision(Int32, Double, Double, Double)
Returns a new instance of the SparseGaussianList class of a given size, with each element having a given mean and precision.
Declaration
public static SparseGaussianList FromMeanAndPrecision(int size, double mean, double precision, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | The size of the list. |
Double | mean | The desired mean. |
Double | precision | The desired precision. |
Double | tolerance | The tolerance for the approximation. |
Returns
Type | Description |
---|---|
SparseGaussianList | The new SparseGaussianList instance. |
FromMeanAndVariance(Int32, Double, Double)
Returns a new instance of the SparseGaussianList class of a given size, with each element having a given mean and variance.
Declaration
public static SparseGaussianList FromMeanAndVariance(int size, double mean, double variance)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | The size of the list. |
Double | mean | The desired mean. |
Double | variance | The desired variance. |
Returns
Type | Description |
---|---|
SparseGaussianList | The new SparseGaussianList instance. |
FromMeanAndVariance(Int32, Double, Double, Double)
Returns a new instance of the SparseGaussianList class of a given size, with each element having a given mean and variance.
Declaration
public static SparseGaussianList FromMeanAndVariance(int size, double mean, double variance, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | The size of the list. |
Double | mean | The desired mean. |
Double | variance | The desired variance. |
Double | tolerance | The tolerance for the approximation. |
Returns
Type | Description |
---|---|
SparseGaussianList | The new SparseGaussianList instance. |
FromNatural(Int32, Double, Double)
CReturns a new instance of the SparseGaussianList class of a given size, with each element having the specified natural parameters.
Declaration
public static SparseGaussianList FromNatural(int size, double meanTimesPrecision, double precision)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | The size of the list. |
Double | meanTimesPrecision | The mean times precision value. |
Double | precision | The precision value. |
Returns
Type | Description |
---|---|
SparseGaussianList | The new SparseGaussianList instance. |
FromNatural(Int32, Double, Double, Double)
Returns a new instance of the SparseGaussianList class of a given size, with each element having the specified natural parameters.
Declaration
public static SparseGaussianList FromNatural(int size, double meanTimesPrecision, double precision, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Int32 | size | The size of the list. |
Double | meanTimesPrecision | The mean times precision value. |
Double | precision | The precision value. |
Double | tolerance | The tolerance for the approximation. |
Returns
Type | Description |
---|---|
SparseGaussianList | The new SparseGaussianList instance. |
Sample(ISparseList<Double>, ISparseList<Double>)
Samples from a list of Gaussian distributions with the specified vectors. of means and precisions
Declaration
public static ISparseList<double> Sample(ISparseList<double> means, ISparseList<double> precs)
Parameters
Type | Name | Description |
---|---|---|
ISparseList<Double> | means | Vector of means. |
ISparseList<Double> | precs | Vector of precisions. |
Returns
Type | Description |
---|---|
ISparseList<Double> | The sample. |
Operators
Division(SparseGaussianList, SparseGaussianList)
Creates a SparseGaussianList distribution which is the ratio of two others.
Declaration
public static SparseGaussianList operator /(SparseGaussianList numerator, SparseGaussianList denominator)
Parameters
Type | Name | Description |
---|---|---|
SparseGaussianList | numerator | The numerator. |
SparseGaussianList | denominator | The denominator. |
Returns
Type | Description |
---|---|
SparseGaussianList | The resulting SparseGaussianList distribution. |
ExclusiveOr(SparseGaussianList, Double)
Creates a SparseGaussianList distribution which is the power of another.
Declaration
public static SparseGaussianList operator ^(SparseGaussianList dist, double exponent)
Parameters
Type | Name | Description |
---|---|---|
SparseGaussianList | dist | The other distribution. |
Double | exponent | The exponent. |
Returns
Type | Description |
---|---|
SparseGaussianList | The resulting SparseGaussianList distribution. |
Multiply(SparseGaussianList, SparseGaussianList)
Creates a SparseGaussianList distribution which is the product of two others.
Declaration
public static SparseGaussianList operator *(SparseGaussianList a, SparseGaussianList b)
Parameters
Type | Name | Description |
---|---|---|
SparseGaussianList | a | The first distribution. |
SparseGaussianList | b | The second distribution. |
Returns
Type | Description |
---|---|
SparseGaussianList | The resulting SparseGaussianList distribution. |