JuliaStats / Distributions.jl

A Julia package for probability distributions and associated functions.
Other
1.11k stars 415 forks source link

Reintroduce `pmf` or equivalent #1483

Open mschauer opened 2 years ago

mschauer commented 2 years ago

With #1470 we introduce distributions D with type parameter Continuous which can have atoms, points a with P(X = a) > 0. There we settled for pdf(D, a) = P(X = a) giving the density with respect to a mixture measure with Dirac components at such points.

That creates the need to answer the question: what is P(X = a)? pdf doesn't tell, and cdf either and we need to know, not at last to compute P(X ≥ a) = 1 - P(X ≤ a) + P(X = a) One first step is to (re-) introduce pmf(D, a) defined to always giving P(X = a) both for Discrete and Continuous distributions.

ParadaCarleton commented 1 year ago

I think we definitely need this; I'm trying to write up a package for queuing models and this is messing me up right now :sweat_smile:

(Customers often have a wait time in line of exactly 0 if they arrive with nobody ahead of them.)