1

I am a bit confused as to the difference between the probability mass function and the probability density function for a distribution of discrete variables. I understand there would be no mass function for a continuous variable distribution, only a density function. But for discrete variable distributions, are there both mass and density functions or are my notes wrong and there is only a mass function?

sion
  • 157
  • 1
  • 1
  • 7

2 Answers2

2

The difference is in how they are evaluated. They are not quite the same thing.

In a discrete distribution, you have a finite number of events, and each event occurs with some probability. Therefore, since the set of events $E$ is finite, it makes sense to have a function $p$ that maps the events to their probabilities, $p(E) : E \to [0,1]$.

In a continuous distribution, any event occurs with probability zero. So it doesn't make sense to have a function that, when evaluated, returns the probability of the variable being that value. In other words, for a continuous random variable $X$, $P(X = x) = 0$.

What does make sense, however, is a function such that the area underneath it is the probability that the random variable is less than or equal to that value. This is a probability density function. The pdf is so named because it gives you a shape that mimics the density of the distribution of a variable in some domain.

In both cases, the analog to area under the curve from the left gives the probability that the random variable is less than or equal to some value. In the discrete case, this is summation of all values to the left. In the continuous case, it is the area under the curve.

Emily
  • 36,334
  • 1
    A somewhat off-topic but relevant question, then - what does one consider the function describing a mixed distribution to be (i.e., with continuous and discrete parts)? Is it a probability density function? – Clarinetist Jun 14 '13 at 21:58
  • 1
    One generally considers that to be a nightmare. – Emily Jun 14 '13 at 21:59
  • So technically there is no such thing as a probability density function for discrete distributions? It should only be called the probability mass function? – sion Jun 15 '13 at 08:52
  • @Sam Correct. The nomenclature exists for a reason. Mass is stuff. Density is a measure of stuff spread out over some volume. Probability mass is probability of assuming a value. Probability density is probability spread out over some area. – Emily Jun 16 '13 at 04:25
  • I can't think of any situations where a binomial distribution would be continuous, I can only think of it being discrete. Therefore it should have a probability mass function and no probability density function. So why does Matlab have a binopdf() function? Shouldn't it be binopmf()? – sion Jun 17 '13 at 12:32
  • @Sam It's bad nomenclature, sort of. The term "pdf" is often used to describe either a density or a mass function. Technically, for a discrete distribution a mass function is also a density function! But the term is used interchangeably because people are lazy and it's also better coding practice to keep the acronyms consistent. But in the sense of generating a Cumulative Distribution Function by integrating from the left a PDF/PMF, then a PMF is essentially the same thing. They only become different when you try to extract meaning from the function evaluation. – Emily Jun 17 '13 at 14:44
0

I've never liked naming the functions differently for both the discrete and continuous cases. I've always learned them both as "probability density function" (in both the discrete and continuous cases). The probability mass function refers to discrete random variables.

Clarinetist
  • 20,278
  • 10
  • 72
  • 137