Skip to content

Error in computing probability of exp and geometric distribution #1141

@blacksde

Description

@blacksde

Exp and Geometric distributions are defined on the positive axis of numbers. When the value is less than zero, the probability (including pmf, pdf, and cdf) of these distributions should be zero. However, currently tfp didn't consider the case that the value is less than zero and give some unreasonable results. For example,

>>> geo = tfp.distributions.Geometric(probs=0.5)
>>> geo.prob(-2.5) # a prob which is larger than one
<tf.Tensor: shape=(), dtype=float32, numpy=4.0>

>>> exp_dist = tfp.distributions.Exponential(0.5)
>>> exp_dist .cdf(-2.5) # a prob which is less than zero
<tf.Tensor: shape=(), dtype=float32, numpy=-2.490343> 

There should be some special treatments for this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions