Skip to content

Random

class Random<Value> < Expression<Value>

Random variate.

  • Value: Value type.

Assignments

Name Description
Value Value assignment.
Value? Optional value assignment.

Member Variables

Name Description
x:Value? Value.
dist:Distribution<Value>? Associated distribution.

Member Functions

Name Description
hasValue Does this have a value?
hasDistribution Does this have a distribution?
value Get the value of the random variate, forcing realization if necessary.
distribution Get the distribution associated with the random variate.
logpdf Evaluate the log probability density (or mass) function, if it exists.
pdf Evaluate the probability density (or mass) function, if it exists.
cdf Evaluate the cumulative distribution function at a value.
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

distribution

function distribution() -> Distribution<Value>

Get the distribution associated with the random variate.

hasDistribution

function hasDistribution() -> Boolean

Does this have a distribution?

hasValue

function hasValue() -> Boolean

Does this have a value?

logpdf

function logpdf(x:Value) -> Real

Evaluate the log probability density (or mass) function, if it exists.

  • x: The value.

Return: the log probability density (or mass).

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, if it exists.

  • x: The value.

Return: the probability density (or mass).

upper

function upper() -> Value?

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

value

function value() -> Value

Get the value of the random variate, forcing realization if necessary.