Show / Hide Table of Contents

Class ProbabilityDistribution

Helpers for calculating probabilities of positive input values, using maximum values or quantiles to define the distribution's shape.

Inheritance
object
ProbabilityDistribution
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.XboxStudios.BotBrain.Statistics
Assembly: BotBrain.Core.dll
Syntax
public static class ProbabilityDistribution
Remarks

"Pseudo" represents not true probabilities, where the area is not necessarily equal to 1.

Methods

View Source

CalculateExponentialRate(float, float)

Calculates the rate for a exponential distribution where the given value represents a certain quantile of the survival function.

Declaration
public static float CalculateExponentialRate(float value, float quantile)
Parameters
Type Name Description
float value

The value whose surviving probability equals the quantile.

float quantile

The quantile.

Returns
Type Description
float

The rate value.

View Source

CalculateLogLogisticScale(float, float, float)

Calculates the scale for a log-logistic distribution where the given value represents a certain quantile of the survival function.

Declaration
public static float CalculateLogLogisticScale(float value, float quantile, float shape)
Parameters
Type Name Description
float value

The value whose surviving probability equals the quantile.

float quantile

The quantile.

float shape

The shape parameter, beta.

Returns
Type Description
float

The scale value.

View Source

Exponential(float, float)

Calculates the survival function of a exponential distribution.

Declaration
public static float Exponential(float x, float rate)
Parameters
Type Name Description
float x

The value whose surviving probability to return.

float rate

The rate parameter, lambda.

Returns
Type Description
float

The surviving probability of the value.

View Source

Linear(float, float)

Calculates a pseudo-probability density function using a line from the point (x = 0, y = 1).

Declaration
public static float Linear(float x, float maxValue)
Parameters
Type Name Description
float x

The value whose probability to return.

float maxValue

The maximum value, or the first value with a probability of zero.

Returns
Type Description
float

The probability of the value.

View Source

LinearFromSlopeIntercept(float, float, float)

Calculates a pseudo-probability density function using a line.

Declaration
public static float LinearFromSlopeIntercept(float x, float slope = -1, float intercept = 1)
Parameters
Type Name Description
float x

The value whose probability to return.

float slope

The slope of the line.

float intercept

The y-axis intercept, 1 by default.

Returns
Type Description
float

The probability of the value.

View Source

LogLogistic(float, float, float)

Calculates the survival function of a log-logistic distribution.

Declaration
public static float LogLogistic(float x, float scale, float shape)
Parameters
Type Name Description
float x

The value whose surviving probability to return.

float scale

The scale parameter, alpha.

float shape

The shape parameter, beta.

Returns
Type Description
float

The surviving probability of the value.

  • View Source
In this article
Back to top Generated by DocFX