Skip to content

Poisson Distribution¤

stamox.distribution.ppoisson(q: Union[Float, ArrayLike], rate: Union[Float, ArrayLike], lower_tail = True, log_prob = False, dtype = <class 'jax.numpy.float64'>) -> ArrayLike ¤

Computes the cumulative distribution function of the Poisson distribution.

Parameters:

Name Type Description Default
q Union[Float, ArrayLike]

The value at which to evaluate the CDF.

required
rate Union[Float, ArrayLike]

The rate parameter of the Poisson distribution.

required
lower_tail bool

Whether to compute the lower tail of the CDF. Defaults to True.

True
log_prob bool

Whether to return the log probability. Defaults to False.

False
dtype jnp.dtype

The dtype of the output. Defaults to jnp.float_.

<class 'jax.numpy.float64'>

Returns:

Type Description
ArrayLike

The cumulative distribution function of the Poisson distribution evaluated at q.

Examples:

>>> ppoisson(1.0, rate=1.0)

stamox.distribution.qpoisson(p: Union[Float, ArrayLike], rate: Union[Float, ArrayLike], lower_tail: Bool = True, log_prob: Bool = False, dtype = <class 'jax.numpy.int64'>) -> ArrayLike ¤

Computes the quantile function of the Poisson distribution.

Parameters:

Name Type Description Default
p Union[Float, ArrayLike]

The probability at which to evaluate the quantile function.

required
rate Union[Float, ArrayLike]

The rate parameter of the Poisson distribution.

required
lower_tail bool

Whether to compute the lower tail of the quantile function. Defaults to True.

True
log_prob bool

Whether to return the log probability. Defaults to False.

False
dtype jnp.dtype

The dtype of the output. Defaults to jnp.int_.

<class 'jax.numpy.int64'>

Returns:

Type Description
ArrayLike

The quantile function of the Poisson distribution evaluated at p.

Examples:

>>> qpoisson(0.5, rate=1.0)

stamox.distribution.dpoisson(x: Union[Float, ArrayLike], rate: Union[Float, ArrayLike], lower_tail = True, log_prob = False, dtype = <class 'jax.numpy.float64'>) -> ArrayLike ¤

Computes the probability density function of the Poisson distribution.

Parameters:

Name Type Description Default
x Union[Float, ArrayLike]

The value at which to evaluate the PDF.

required
rate Union[Float, ArrayLike]

The rate parameter of the Poisson distribution.

required
lower_tail bool

Whether to compute the lower tail of the PDF. Defaults to True.

True
log_prob bool

Whether to return the log probability. Defaults to False.

False
dtype jnp.dtype

The dtype of the output. Defaults to jnp.float_.

<class 'jax.numpy.float64'>

Returns:

Type Description
ArrayLike

The probability density function of the Poisson distribution evaluated at x.

Examples:

>>> dpoisson(1.0, rate=1.0)

stamox.distribution.rpoisson(key: PRNGKeyArray, sample_shape: Optional[Sequence[int]] = None, rate: Union[Float, ArrayLike] = None, lower_tail = True, log_prob = False, dtype = <class 'jax.numpy.int64'>) -> ArrayLike ¤

Generates samples from the Poisson distribution.

Parameters:

Name Type Description Default
key KeyArray

Random number generator state used for random sampling.

required
rate Union[Float, ArrayLike]

The rate parameter of the Poisson distribution.

None
sample_shape Optional[Shape]

Shape of the output array. Defaults to None.

None
lower_tail bool

Whether to return the lower tail probability. Defaults to True.

True
log_prob bool

Whether to return the log probability. Defaults to False.

False
dtype jnp.dtype

The dtype of the output. Defaults to jnp.int_.

<class 'jax.numpy.int64'>

Returns:

Type Description
ArrayLike

Samples from the Poisson distribution.

Examples:

>>> key = jrand.PRNGKey(0)
>>> rpoisson(key, rate=1.0)