0

It seems like even if distributions are continuous, I only have an access to the pdf method. However, I need the probability itself, say in [2, 2.0001]. Is there any method that I can call for a point probability? According to the document https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.beta.html, it doesn't seem like to have one.

How do you get the probability at one point, in the most economic way?

aerin
  • 20,607
  • 28
  • 102
  • 140
  • For a continuous distribution, the probability at a point is 0. See@alexpiers' answer for how to get the probability for an interval. – Warren Weckesser Dec 17 '19 at 00:14
  • You have implicitly identified how to reconcile your desire ("point probability") with the technical detail that @Warren mentiones. You chose a small enough interval to treat as "point-like" for your purposes. Great. But ... don't go *too* small or floating point math issues will rear their ugly heads. – dmckee --- ex-moderator kitten Dec 17 '19 at 01:45
  • @warren I'm very well aware that the probability of a point is zero. That's why I asked this question from the beginning -_- – aerin Dec 17 '19 at 02:04
  • @dmckee yup, when I said "at point" I meant "point-like". – aerin Dec 17 '19 at 02:04

1 Answers1

3

You can use the cdf method.

So the probability of an event occuring in some interval [a,b] is just cdf(b)-cdf(a).

alexpiers
  • 696
  • 5
  • 12
  • 1
    OP will want to note that, for well-behaved distributions, cdf(b) - cdf(a) is going to be pretty well approximated by (b - a) times pdf(a), for b sufficiently close to a. – Robert Dodier Dec 17 '19 at 22:11