Deterministic#

class DeterministicPMF(name, value, tol=1e-05)[source]#

Bases: RandomVariable

A deterministic (degenerate) random variable that represents a PMF.

Parameters:
  • name (str)

  • value (ArrayLike)

  • tol (float)

sample(**kwargs)[source]#

Retrieves the deterministic PMF

Parameters:

**kwargs (dict, optional) – Additional keyword arguments passed through to internal sample() calls, if any

Return type:

ArrayLike

size()[source]#

Returns the size of the PMF

Returns:

The size of the PMF

Return type:

int

static validate(value)[source]#

Validates input to DeterministicPMF

Parameters:

value (ArrayLike) – An ArrayLike object.

Return type:

None

class DeterministicVariable(name, value)[source]#

Bases: RandomVariable

A deterministic (degenerate) random variable. Useful to pass fixed quantities.

Parameters:
  • name (str)

  • value (ArrayLike)

sample(record=False, **kwargs)[source]#

Retrieve the value of the deterministic Rv

Parameters:
  • record (bool, optional) – Whether to record the value of the deterministic RandomVariable. Defaults to False.

  • **kwargs (dict, optional) – Additional keyword arguments passed through to internal sample calls, should there be any.

Return type:

ArrayLike

static validate(value)[source]#

Validates input to DeterministicVariable

Parameters:

value (ArrayLike) – An ArrayLike object.

Return type:

None

Raises:

Exception – If the input value object is not an ArrayLike object.

class NullObservation[source]#

Bases: NullVariable

A null observation random variable. Sampling returns None.

sample(mu, obs=None, **kwargs)[source]#

Retrieve the value of the Null (None)

Parameters:
  • mu (ArrayLike) – Unused parameter, represents mean of non-null distributions

  • obs (ArrayLike, optional) – Observed data. Defaults to None.

  • **kwargs (dict, optional) – Additional keyword arguments passed through to internal sample calls, should there be any.

Return type:

None

static validate()[source]#

Not used

Return type:

None

class NullVariable[source]#

Bases: DeterministicVariable

A null (degenerate) random variable. Sampling returns None.

sample(**kwargs)[source]#

Retrieve the value of the Null (None)

Parameters ———-. **kwargs : dict, optional

Ignored.

Return type:

None

static validate()[source]#

Not used

Return type:

None