Article 6G7BM Using dimensional analysis to check probability calculations

Using dimensional analysis to check probability calculations

by
John
from John D. Cook on (#6G7BM)

Probability density functions are independent of physical units. The normal distribution, for example, works just as well when describing weights or times. But sticking in units anyway is useful.

Normal distribution example

Suppose you're trying to remember the probability density function for the normal distribution. Is the correct form

dimensional_normal0.svg

or

dimensional_normal1.svg

or

dimensional_normal2.svg

or maybe some other variation?

Suppose the distribution represents heights. (More on that here, here, and here.) The argument to an exponential function must be dimensionless, so the numerator and denominator in the exp() argument must have the same units. Since x has units of length, must have units of length. So the numerator has units of length squared, and the denominator must also have units of length squared.

The standard deviation of a quantity has the same units as the quantity. If you have a set of dollar amounts, then the standard deviation of the set is also a dollar amount, not dollars squared or square root of dollars or anything else. The first expression above cannot be right because the numerator has units of length squared but the denominator has units of length.

Next let's think about how we use a density function. Densities exist to be integrated. This is an important: Densities are not probabilities. They are things you integrate to produce probabilities. So when you integrate the expression above you should get a probability, not a length or any other dimensional quantity. When you integrate with respect to x, the integral has a dx term. Since x has units of length, dx has units of length. That means the density must have units of length-1, i.e. length inverse.

The second and third expressions look very similar. The difference is whether ^2 is inside or outside of the square root. If it is inside, the density has units of length-1, but if it is outside then the density has units of length-2. If we integrate the former dx we get a dimensionless quantity, but if we integrate the latter then we get a quantity with dimensions of inverse length. So the second expression cannot be right.

We can't prove from dimensional analysis alone that the third expression is correct, but we can say that it's plausible, and in fact it is correct.

Gamma distribution example

Let's look at one more example, the gamma distribution density with shape parameter and scale parameter .

gamma_density.svg

There's a lot going on here. Are we sure the expression above is correct?

First of all, the argument to an exponential function must be dimensionless, so must have the same units as x. If x is in Euros, must be in Euros. If x is in light-years, better be in light-years. If x is in amps, is in amps.

This is always the case with a scaling parameter, for any probability distribution: the scaling parameter has the same units as the independent variable.

Now what about the shape parameter ? It appears inside a gamma function, so it better be dimensionless.

If x has dimension of length, so do and dx. The terms in front of the exponential have dimensions of length-1, which checks out: when we integrate the gamma density dx we get a dimensionless quantity. The units of length cancel out. If we assume x is volume in liters, then and dx also have units of liters, and the density has units of per liter. When we integrate we get a probability, not a quantity in liters or any other units.

Related postsThe post Using dimensional analysis to check probability calculations first appeared on John D. Cook.
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments