Is there a standard deviation of a continuous function?

249 Views Asked by At

Suppose we are given a continuous function $f \colon [a, b] \to \mathbb{R}$. The mean value of $f$ on $[a, b]$ is defined as $$ \mu = \frac{\displaystyle \int_a^b f(x) \; \mathrm{d}x}{b - a}. $$ Question: is there any way to define a continuous standard deviation of $f$ on $[a, b]$? For example, if $f$ is constant on $[a, b]$, the continuous standard deviation should be zero.

1

There are 1 best solutions below

1
On BEST ANSWER

Well, we normally define $$ \sigma := \sqrt{ \frac 1 n \sum (x_i - \mu)^2 } $$ as the standard deviation of data points $x_i$ with mean $\mu$. The most natural extrapolation of this formula would be $$ \sigma := \sqrt{ \frac{1}{b-a} \int_a^b \left[ f(x) - \frac{1}{b-a} \int_a^b f(y) \, \mathrm{d} y \right]^2\, \mathrm{d} x} $$ (Why natural? Well, you clearly know the average value formula. When one thinks of an integral as a continuous analogue of summation, it falls together nicely.)

This could be simplified by noting that $$ \mu := \frac{1}{b-a} \int_a^b f(x) \, \mathrm{d} x $$ is ultimately just some constant, so you would get (after some careful algebra) $$ \sigma = \sqrt{ \frac{1}{b-a} \int_a^b f^2(x) \, \mathrm{d} x - \mu^2} = \sqrt{ \frac{1}{b-a} \int_a^b f^2(x) \, \mathrm{d} x - \left( \frac{1}{b-a} \int_a^b f(x) \, \mathrm{d} x \right)^2} $$

I will note that this doesn't entirely match up with the notions we usually have from, say, probability theory though -- but if one wants to take the average of a function (as opposed to the expected value of data) as a starting point, it feels reasonable enough. Whether it's useful is another question.

Note that $\sigma = 0$, as desired, if $f$ is constant, to point out something you explicitly desired.


I may as well explain the entity we see in probability theory. Given a probability density function $f$ for a random variable $X$, we define its expectation (or mean) by $$ \mathbb{E}[X] := \int_{-\infty}^\infty x f(x) \, \mathrm{d} x $$ (provided we simply assume, if necessary, $f \equiv 0$ for values outside the range of $X$ - you can think of $X$ as a function taking random values in a continuous range with probabilities dictated by $f$). This should, intuitively, represent a different sort of average: we are (in a continuous sense) adding up the values $x$ associated to an event, weighted by the probabilities $f(x)$ that they happen.

Then we can define a notion of variance, given by $$ \mathbb{V}[X] := \mathbb{E} \Big[ \big( X - \mathbb{E}[X] \big)^2 \Big] \equiv \mathbb{E}[X^2] - \mathbb{E}[X]^2 $$ and naturally, if one desired (though it's never actually come up often for me outside of the normal distribution), a standard deviation defined by the rule $$ \mathbb{S}[X] := \sqrt{\mathbb{V}[X]} $$ Note that these notions match up comparably with the algebra we did earlier (and in fact even work well for the discrete case where we use a summation, if one is versed in measure theory). In this sense, an explicit formula for variance would be given by $$ \mathbb{S}[X] = \sqrt{\int_{-\infty}^\infty x^2 f(x) \, \mathrm{d} x - \left( \int_{-\infty}^\infty x f(x) \, \mathrm{d} x \right)^2} $$ This makes use of a theorem: that $$\mathbb{E}[g(X)] = \int_{-\infty}^\infty g(x) f(x) \, \mathrm{d} x$$