Class PointMass<T>
A point mass, which is the 'distribution' you get for an observed variable. All the probability mass is at the point given by observed value.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Serializable]
[DataContract]
[Quality(QualityBand.Mature)]
public class PointMass<T> : IDistribution<T>, IDistribution, ICloneable, Diffable, SettableToUniform, HasPoint<T>, CanGetLogProb<T>, Sampleable<T>, CanGetMean<T>, SettableTo<PointMass<T>>, SettableToProduct<PointMass<T>>, SettableToProduct<PointMass<T>, PointMass<T>>, SettableToRatio<PointMass<T>>, SettableToRatio<PointMass<T>, PointMass<T>>, SettableToPower<PointMass<T>>, SettableToWeightedSum<PointMass<T>>, CanGetLogAverageOf<PointMass<T>>, CanGetAverageLog<PointMass<T>>Type Parameters
| Name | Description | 
|---|---|
| T | 
Constructors
PointMass(T)
Creates a point mass at the specified location.
Declaration
[Construction(new string[]{"Point"})]
public PointMass(T point)Parameters
| Type | Name | Description | 
|---|---|---|
| T | point | The location of the point mass. | 
Properties
IsPointMass
Always returns true.
Declaration
[IgnoreDataMember]
public bool IsPointMass { get; }Property Value
| Type | Description | 
|---|---|
| Boolean | 
Point
The location of the point mass.
Declaration
[DataMember]
public T Point { get; set; }Property Value
| Type | Description | 
|---|---|
| T | 
Methods
Clone()
Creates a copy of the point mass.
Declaration
public object Clone()Returns
| Type | Description | 
|---|---|
| Object | The new PointMass object | 
Create(T)
Creates a point mass at the specified location.
Declaration
public static PointMass<T> Create(T point)Parameters
| Type | Name | Description | 
|---|---|---|
| T | point | The location of the point mass. | 
Returns
| Type | Description | 
|---|---|
| PointMass<T> | 
Equals(Object)
Declaration
public override bool Equals(object obj)Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
Overrides
GetAverageLog(PointMass<T>)
Returns 0 if the this and that point mass are equal, negative infinity otherwise
Declaration
public double GetAverageLog(PointMass<T> that)Parameters
| Type | Name | Description | 
|---|---|---|
| PointMass<T> | that | 
Returns
| Type | Description | 
|---|---|
| Double | Not implemented | 
GetHashCode()
Declaration
public override int GetHashCode()Returns
| Type | Description | 
|---|---|
| Int32 | 
Overrides
GetLogAverageOf(PointMass<T>)
Returns 0 if the this and that point mass are equal, negative infinity otherwise
Declaration
public double GetLogAverageOf(PointMass<T> that)Parameters
| Type | Name | Description | 
|---|---|---|
| PointMass<T> | that | 
Returns
| Type | Description | 
|---|---|
| Double | Not implemented | 
GetLogProb(T)
Returns 0 if the value is at the point mass and negative infinity elsewhere.
Declaration
public double GetLogProb(T value)Parameters
| Type | Name | Description | 
|---|---|---|
| T | value | The value at which to compute the log probability. | 
Returns
| Type | Description | 
|---|---|
| Double | 0 or negative infinity | 
GetMean()
Returns the location of the point mass
Declaration
public T GetMean()Returns
| Type | Description | 
|---|---|
| T | 
IsUniform()
Always returns false
Declaration
public bool IsUniform()Returns
| Type | Description | 
|---|---|
| Boolean | false | 
MaxDiff(Object)
Returns 0 if the two distributions are the same, positive infinity otherwise.
Declaration
public double MaxDiff(object that)Parameters
| Type | Name | Description | 
|---|---|---|
| Object | that | 
Returns
| Type | Description | 
|---|---|
| Double | 
Sample()
Returns the location of the point mass
Declaration
public T Sample()Returns
| Type | Description | 
|---|---|
| T | 
Sample(T)
Returns the location of the point mass
Declaration
public T Sample(T result)Parameters
| Type | Name | Description | 
|---|---|---|
| T | result | Where to put the result | 
Returns
| Type | Description | 
|---|---|
| T | 
SetTo(PointMass<T>)
Sets this point mass to that point mass
Declaration
public void SetTo(PointMass<T> value)Parameters
| Type | Name | Description | 
|---|---|---|
| PointMass<T> | value | 
SetToPower(PointMass<T>, Double)
Sets to the value of the given point mass
Declaration
public void SetToPower(PointMass<T> value, double exponent)Parameters
| Type | Name | Description | 
|---|---|---|
| PointMass<T> | value | |
| Double | exponent | 
SetToProduct(PointMass<T>, PointMass<T>)
Throws an exception unless the two point masses are equal
Declaration
public void SetToProduct(PointMass<T> a, PointMass<T> b)Parameters
| Type | Name | Description | 
|---|---|---|
| PointMass<T> | a | |
| PointMass<T> | b | 
SetToRatio(PointMass<T>, PointMass<T>, Boolean)
Not supported
Declaration
public void SetToRatio(PointMass<T> numerator, PointMass<T> denominator, bool forceProper)Parameters
| Type | Name | Description | 
|---|---|---|
| PointMass<T> | numerator | |
| PointMass<T> | denominator | |
| Boolean | forceProper | 
SetToSum(Double, PointMass<T>, Double, PointMass<T>)
Throws an exception unless the point masses are equal
Declaration
public void SetToSum(double weight1, PointMass<T> value1, double weight2, PointMass<T> value2)Parameters
| Type | Name | Description | 
|---|---|---|
| Double | weight1 | |
| PointMass<T> | value1 | |
| Double | weight2 | |
| PointMass<T> | value2 | 
SetToUniform()
Always throws an exception, since a PointMass cannot be set to uniform.
Declaration
public void SetToUniform()ToString()
Declaration
public override string ToString()Returns
| Type | Description | 
|---|---|
| String |