4

In dimensional analysis, the argument of an analytic function cannot have dimensions, because if you were to expand the function in a Taylor series, you'd end up adding terms e.g. $1+x+\frac{x^2}{2}+\cdots$ that are dimensionally inconsistent. For example, if $x$ has dimension of length, then to consider $e^{−\alpha x^2}$ in dimensional analysis, $\alpha$ must have dimension of $\left[{\rm L^{−2}}\right]$.

Now suppose we have that $X$ is a random variable with standard normal distribution, so its density is $$f(x)=\frac{1}{\sqrt{2\pi}}e^{\frac{-x^2}{2}}.$$ If $X$ has units of length, then so should its expectation $E[X]$. However, we seem to be violating the rule about arguments of functions being dimensionless when we consider $$E[X]=\int_{\mathbb{R}}xf(x)\ \text dx,$$ since $e^x$ is analytic, but we're saying $X$ has dimension of length. So can someone explain what is going on here? I know that $f(x)$ is supposed to have units $\rm L^{-1}$, and that makes $E[X]$ have dimension of length, but I'm confused why we can consider $X$ as having dimension of length and at the same time be the argument for $f$.

Alwaz
  • 124

4 Answers4

15

The general form for a correctly normalized Gaussian distribution for one variable $x$ with mean $x_0$ and standard deviation $\sigma$ is $$ f(x) = \frac{1}{\sqrt{2\pi} \sigma} e^{-(x-x_0)^2/2\sigma^2} $$ Say that $x$ represents length. Then $x$, $x_0$, and $\sigma$ all have units of length. Meanwhile, $f(x)$ has units of $1/{\rm length}$ because of the factor of $1/\sigma$, and the argument of the exponential is dimensionless.

The version of the Gaussian you wrote took $x_0=0$ and $\sigma=1$. The latter condition, in particular, implicitly assumes that $\sigma$ is dimensionless, which implies that $x$ is dimensionless. So the version of the Gaussian you wrote down could not be used to model a quantity with units of length.

Andrew
  • 58,167
8

You are right. If $X$ has dimension of length, then the distribution $$f(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}$$ can't be correct because the exponent is not dimension-less. Actually the normal distribution is $$f(x)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-(x-\mu)^2/2\sigma^2}$$ where $\mu$ is the mean value and $\sigma$ is the standard deviation of $X$ (both having dimension of length). You see that the exponent is dimension-less and $f(x)$ has dimension length$^{-1}$, as it should be. And $$E[X]=\int_{\mathbb{R}}xf(x)dx=\mu$$ correctly gives a result with dimension of length.

2

The question regarding this concrete example was already answered, but I would like to point out that there's a more general logical fallacy in its premise.

In dimensional analysis, the argument of an analytic function cannot have dimensions, because if you were to expand the function in a Taylor series...

First off, what you mean here is of course not that every analytic function has this problem, but specifically analytic functions that are neither constant nor linear (which to be fair most aren't). Just because a linear function could be expanded into an infinite Taylor series doesn't mean that you need to consider this possibility and any ramifications arising from the $x^2$ term (with coefficient zero) that would occur in that Taylor series. Generally I'd say Taylor series are overemphasized in education: they are just a tool, one particular way in which functions can be expressed but not the canonical framework in which all analytic functions should be considered always. In fact, in many practical situations Taylor series have poor convergence; the function in your example is very inefficient to describe by Taylor expansion except for small $x$.

But even if we do use Taylor series... it's actually perfectly possible to have nonlinear functions whose argument is a dimensional quantity! Indeed, your correctly written function $$\begin{align} f &\colon \mathrm{length} \to \mathrm{length}^{-1} \\ f(x) &= \frac1{\sqrt{2\pi}\sigma}\exp\left(-\frac{x^2}{2\sigma^2}\right) \end{align}$$ is still an analytic function that can be expanded into a Taylor series!

Why, $$\begin{align} f(x) &= \frac1{\sqrt{2\pi}\sigma} - \frac{x^2}{2\sqrt{2\pi}\sigma^3} + \frac{x^4}{8\sqrt{2\pi}\sigma^5} - \ldots \end{align}$$ Yes, we have terms with different powers of $x$ here, but each of them also comes with a corresponding power of $\sigma$ that cancels the dimension of that term. This drops out when you differentiate $f$ for the Taylor expansion. So in the end, it's again just a sum of terms that all have the same physical dimension of $\mathrm{length}^{-1}$.

What's true is that the special functions are defined to take dimensionless arguments. But that's not because they are analytic / can be Taylor-expanded, but simply because they're defined in purely mathematical terms that shouldn't have grubby physics in them. If the sine function allowed its input to have dimension length, it would mean a) it would have a particular length-scale built in b) it couldn't be used with e.g. times or temperatures as the argument.

Even so, one of the special functions can actually be evaluated on dimensional quantities quite reasonably.

2
  1. Integration doesn't really have anything to do with it. Once you have $f(x)=\frac{1}{\sqrt{2\pi}}e^{\frac{-x^2}{2}}$, if $x$ has non-trivial dimension, then $f(x)$ is incoherent from a dimensional analysis perspective.
  2. $f(x)$ here is the PDF. When we talk about the dimension of a random variable, we're generally talking about the dimension of elements of the sample space. The PDF is always dimensionless. If $x$ has dimension of length, then $E[X]$ picks up that dimension from the $x$ in $xf(x)$.
  3. Analytic functions can have inputs with non-trivial dimension. The relevant property is homogeneity. A homogenous polynomial is a polynomial where all non-zero terms have the same order. For instance, $x^2+xy+y^2$ is a homogenous polynomial because all the terms are order 2. A homogenous polynomial of one variable will just be a monomial. That is, there will just be the variable raised to a power, and no other terms. For instance, you could have $f(x) = x^3$. If $x$ has dimension of length, then $f$ will have dimension of volume. You're probably confused by the fact that infinite power series define analytic functions. However, not all analytic functions have an infinite power series. Or, at least, not a power series with infinite non-zero terms. Analytic functions can have Taylor series where all the terms past a certain point are zero.
  4. Now, getting to the core of your question: the equation for a normal distribution is $f(z)=\frac{1}{\sqrt{2\pi}}e^{\frac{-z^2}{2}}$, where $z=\frac{x-\mu_x}{\sigma_x}$. $\sigma_x$ has the same dimensions as $x$, so even if $x$ has non-trivial dimension, $z$ will not. We will calculate the same value of $z$ regardless of what units $x$ is measured in. For instance, if one person measures temperature in Celsius and another person measures it in Fahrenheit, they will get the same numbers for $z$, even though their $x$ will have different numbers. What matters when taking a non-homogenous function of a variable is whether that variable has non-trivial units. If that variable can be expressed in terms of other variables that have non-trivial dimensions, that doesn't matter, as long as those units cancel out. So we can have $\sin(\theta)$ as long as $\theta$ is dimensionless. If $\theta$ is calculated as distance divided by arclength, the length dimension of arclength cancels out the length dimension of distance, so it doesn't matter that there are quantities in the input of $\sin$, because there's no net dimension. Any time you see a non-homogenous function where the input is a variable times a constant, you can conclude that the dimensions of the constant cancel out the dimensions of the variable. If you have a homogenous function, on the other hand, dimensions don't have to cancel out. For instance, the formula for the maximum velocity of a spring is $v = \sqrt{\frac{kx^2}m}$. The dimensions inside the square root are length squared over time squared, so when we take the square root, we get length over time.