Probability

In the SciPy stack, we have two means for determining probability: a symbolic setting and a numerical setting. In this brief section, we are going to compare both with a sequence of examples.

For the symbolic treatment of random variables, we employ the module sympy.stats, while for the numerical treatment, we use the module scipy.stats. In both cases, the goal is the same—the instantiation of any random variable, and the following three kinds of operations on them:

  • Description of the probability distribution of a random variable with numbers (parameters).
  • Description of a random variable in terms of functions.
  • Computation of associated probabilities.

Let's observe several situations through the scope of the two different settings.

Symbolic ...

Get Mastering SciPy now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.