Observation#

Negative Binomial#

class NegativeBinomialObservation(name, concentration_rv, eps=1e-10)[source]#

Bases: RandomVariable

Negative Binomial observation

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

Sample from the negative binomial distribution

Parameters:
  • mu (ArrayLike) – Mean parameter of the negative binomial distribution.

  • obs (ArrayLike, optional) – Observed data, by default None.

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

Return type:

ArrayLike

static validate(concentration_rv)[source]#

Check that the concentration_rv is actually a RandomVariable

Parameters:

concentration_rv (any) – RandomVariable from which to sample the positive concentration parameter of the negative binomial.

Return type:

None

Poisson#

class PoissonObservation(name, eps=1e-08)[source]#

Bases: RandomVariable

Poisson observation process

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

Sample from the Poisson process

Parameters:
  • mu (ArrayLike) – Rate parameter of the Poisson distribution.

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

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

Return type:

ArrayLike

static validate()[source]#

Validation of kwargs to be implemented in subclasses.