# Is there a “smooth” version of a median of a data set?

So I'm thinking about how one would compare sizes of past civilizations in terms of population size and territory, and imagining that the distributions are basically continuous variables. I know there is a clear sense in which one can compute their average size over some defined time, namely if $f(t)$ is the population at time $t$ then $\frac{\int_a^bf(t)\, dt}{b-a}$ would be the average.

But the average is influenced by skew so it'd be good to have a more robust statistic, if I'm using that word correctly. But how could you define a meaningful notion of "median population" for a continuous population function of time? If you just found the so-to-speak balancing point on the time-population graph it could easily be located at a very intuitively atypical population. I have in mind for example $-x(x-1)^2(x-2)$ from 0 to 2, which has a balancing point at 0 population.

So is there a better definition for the median of such a function?

• For continuous distributions, the median is just the 50th percentile. You'd have to find an $M$ such that $\int_a^M f(t)dt = \int_M^B f(t)dt$. For symmetrical distributions (such as $x(x-1)^2(2-x)$ the median and the mean coincide. – user3697176 Aug 15 '15 at 15:29
• @user3697176 In the example given, though, that would make $M=1$ and $f(M)=0$ which is clearly not measuring what's intended. It would show the point at which half the population is in the future and half the population is in the past, so it would be the median time in a sense. But I'm wondering about the median population. – Addem Aug 15 '15 at 17:19
• Intuitively it should coincide with some notion of re-arranging the data from least to greatest and finding the middle rank, but how do you re-arrange a continuous distribution? I guess you could set it up by "discretizing" it into $n$ piece and get a generic formula, then taking the limit as $n\rightarrow \infty$. But I'm not sure a generic formula will exist even for "nice" functions. – Addem Aug 15 '15 at 17:20
• – Alexis Jul 2 '19 at 17:15

I would just create a vector with one population value for each year you are interested in (or month, day, whatever time scale you are using), disregard the order, and just calculate the median of that vector. This would not get you into any of the trouble with $−x(x−1)^2(x−2)$ as I believe the median here would be around 0.1 .
• How are you getting the median of $-x(x-1)^2(x-2)$? It seems like the process you're describing is to essentially choose an arbitrary, satisfactory level of approximation--which is fine for any application I might have in mind, but I kind of got interested in the mathematical theoretical question once it occurred to me. Are you just experimentally determining the limit of $n$ approximations using software or something like that? – Addem Aug 15 '15 at 17:27