Distributions#

class CensoredNormal(loc=0, scale=1, lower_limit=-inf, upper_limit=inf, validate_args=None)[source]#

Bases: Distribution

Censored normal distribution under which samples are truncated to lie within a specified interval. This implementation is adapted from dylanhmorris/host-viral-determinants

arg_constraints = {'loc': Real(), 'scale': Positive(lower_bound=0.0)}#
log_prob(*args, **kwargs)#

Evaluates the log probability density for a batch of samples given by value.

Parameters:

value – A batch of samples from the distribution.

Returns:

an array with shape value.shape[:-self.event_shape]

Return type:

numpy.ndarray

pytree_data_fields = ('loc', 'scale', 'lower_limit', 'upper_limit', '_support')#
sample(key, sample_shape=())[source]#

Generates samples from the censored normal distribution.

Returns:

Containing samples from the censored normal distribution.

Return type:

Array

property support#