Skip to content

Distribution


abstract class Distribution<Value> < Delay

Distribution with delayed-sampling support.

  • Value: Value type.

Member Variables

Name Description
childValue:Value? Value of next node on the M-path. This is an optimization. It is only used when the Distribution is used with the <~ or ~> operator with a variable of basic type, rather than of Random type, on the left. It keeps the value of that variable here, rather than wrapping it in a Random object to keep on the M-path.

Member Functions

Name Description
supportsLazy Are lazy operations supported?
simulate Simulate a value.
simulateLazy Simulate a value as part of a lazy expression.
logpdf Evaluate the log probability density (or mass) function.
logpdfLazy Construct a lazy expression for the log probability density (or mass).
update Update the parent node on the M-path given the value of this node.
updateLazy Update the parent node on the M-path given the value of this node.
pdf Evaluate the probability density (or mass) function.
cdf Evaluate the cumulative distribution function at a value.
quantile Evaluate the quantile function at a cumulative probability.
lower Finite lower bound of the support of this node, if any.
upper Finite upper bound of the support of this node, if any.

Member Function Details

cdf

function cdf(x:Value) -> Real?

Evaluate the cumulative distribution function at a value.

  • x: The value.

Return: the cumulative probability, if supported.

logpdf

abstract function logpdf(x:Value) -> Real

Evaluate the log probability density (or mass) function.

  • x: The value.

Return: the log probability density (or mass).

logpdfLazy

function logpdfLazy(x:Expression<Value>) -> Expression<Real>?

Construct a lazy expression for the log probability density (or mass).

  • x: The value.

Return: expression giving the log probability density (or mass), if supported.

lower

function lower() -> Value?

Finite lower bound of the support of this node, if any.

pdf

function pdf(x:Value) -> Real

Evaluate the probability density (or mass) function.

  • x: The value.

Return: the probability density (or mass).

quantile

function quantile(P:Real) -> Value?

Evaluate the quantile function at a cumulative probability.

  • P: The cumulative probability.

Return: the quantile, if supported.

simulate

abstract function simulate() -> Value

Simulate a value.

Return: the value.

simulateLazy

function simulateLazy() -> Value?

Simulate a value as part of a lazy expression.

Return: the value, if supported.

supportsLazy

function supportsLazy() -> Boolean

Are lazy operations supported?

update

function update(x:Value) -> Delay?

Update the parent node on the M-path given the value of this node.

  • x: The value.

updateLazy

function updateLazy(x:Expression<Value>) -> Delay?

Update the parent node on the M-path given the value of this node.

  • x: The value.

upper

function upper() -> Value?

Finite upper bound of the support of this node, if any.