The Generalized f-Mean
churchofthought.org
churchofthought.org
However, there are two big caveats:
(1) You can't use any symmetric binary function, for the mean to make sense, f must be at least injective and monotonic (and you probably want it to be continuous as well). If you pick a suitable f, many useful properties of the mean are respected.
(2) In general, for an arbitrary choice of f the resulting mean won't be homogenous, which is disqualifying for most practical applications (because, for example, the mean would not be guaranteed to have the same dimensions as the elements). Restricting ourselves to functions in the form $f(x) = x^a$ for $a \in \mathbb{R} \setminus 0$ yields a well-behaved collection of means (Holder means), guaranteed to be homogenous. As a bonus, for any set $S$ of positive real numbers, if we let $GM(S)$ be the geometric mean of $S$ and $M_{a}(S)$ be the mean of $S$ for some $a$, you can prove that $\lim_{a \rightarrow 0} M_{a}(S) = GM(S)$.
All this article is doing, in a somewhat confused fashion, is trying to replace addition with another abelian (but not associative) operator. Which is fun, but ultimately not better than just assuming the arithmetic mean is going to be any help (which at least has some strong theorems that tell you it's going to converge to the expected value, usually).
I genuinely smiled when the article says "any function". "Any function" in math means any function :-)
There's a reason why theorems involving arbitrary functions start with a list of qualifiers as hypotheses.
That comes from the fact that they don't understand the data they are dealing with (as you said with dimensions). You cannot use the arithmetic mean on interest rates because it does not make sense to add them up. If you just go for the geometric mean "because it's a rate and I have read online I should use geometric mean" then you won't learn why you need to use the geometric mean.
Frequencies also don't add up.... But wavelength or time do. So their inverse can be added. So their inverses can have an arithmetic mean. So you can physically meaningfully do the arithmetic mean of their inverse, and inverse the result back again
If you're going down that route, which operations make sense and which don't boil down to the algebraic structure of the set of the possible values of the datatype. For example, you can't add dates but you can subtract dates, because dates have an affine structure, therefore the arithmetic mean of January 14 and October 13 is an operation that makes sense. Similarly with temperatures.
The thing is that it's sometimes tricky and unintuitive to figure out what you're allowed to do: ratios are a good example because you can add them, it just doesn't mean what most people expect it to mean.
I do agree that understanding your data goes a long way, but I believe making people more aware that tools other than "sum / n" exist is worthwhile, even though the article does have problems as I highlighted above.
For dates I believe you're right because they are vectors (what you think is "an absolute date in the calendar" is in fact the time elapsed after 00h00 year=1 after christ, so it's in fact relative)
For dates it's really easy to see, because when you're talking about the calendar you're actually talking about two different types of objects, absolute time references (i.e. Thursday January 1, 1970 12:00 AM) and time durations (i.e. 45 minutes). (If you're familiar with Java, Instants and Durations). Time references cannot be added nor subtracted, but you can add a time duration to a time reference (midnight + 45 minutes = 12:45 AM of the same day) and the difference of two absolute time references is well-defined, unique and is a duration (1 AM - 12 AM = 1 hour). Furthermore, durations satisfy the axioms of a vector space (trivially, just pick a canonical unit, e.g. 1 second, and measure everything as a multiple/fraction of that).
The same holds with temperatures, with the unfortunate difference that we use the same notation for differences in temperatures (vectors of the affine space) and temperature references (base set of the affine space). For example, you can't add 18 celsius and 20 celsius, but saying that the temperature of a room increased by 2 celsius is meaningful, because "+2 celsius" is actually a vector. You can also add vectors to points, if the temperature increased by 2 more celsius, it would be 22 celsius. This does even have a physical meaning, and is independent of the frame of reference you pick for temperatures: a difference of 2 celsius is the same as a difference of 2 kelvin. (the same reasoning holds when replacing "celsius" with "fahrenheit" and "kelvin" with "rankine"). It is equally easy to verify temperature differences satisfy the axioms of a vector space, with the same argument as before.
Replace "temperature" by "speed in kilometer/hour" in your sentence : "we cannot add 18 km/h and 20 km/h but I can add 2 km/h to 18 km/h because +2 km/h is a vector" it doesn't make sense to me
Speeds are vectors in the first place, that's why you get to add them, while "temperature" denotes, depending on context, either a point (not addable) or a vector (addable).
This explains why you can't add temperatures, but the average temperature makes 100% sense and has a direct physical meaning.
> Speed and temperature are intensive properties, they don't add up.
You can add speeds by their very definition. They are vectors in R^3 (or some other coordinate system, you get the point). The fact that addition of vectors is allowed is literally baked into the axioms of a vector space.
> Average temperature has no meaning it's a common fallacy
Yes, average temperature does have unambiguous meaning: https://en.wikipedia.org/wiki/Boltzmann_constant
> You can remove the unit and do whatever you want mathematically and add back the physical unit, but it's not physics.
You do realize math can handle units of measurements/dimensions just fine, do you?
Yes that's exactly what I'm talking about. Kelvin don't support the addition operator. You can pretend it's not Kelvin/Celsius, do something with the number, and add back the unit if you like, but it won't have any physical meaning.
> Yes, average temperature does have unambiguous meaning: https://en.wikipedia.org/wiki/Boltzmann_constant
... in an ideal gas model you can have a meaning adding and averaging k*T with k a magical constant that transforms your intensive property into extensive (energy)
> You can add speeds by their very definition
Definition of time derivation of the position function ? Yeah well [length]/[time] don't add up that's it. You need to first give a meaning to the addition operator of [length]/[time]. I'm talking in one dimension, of course if you can prove this then going 2D or 3D is easy
This isn't quite correct. You can take the arithmetic mean of interest rates, and it is meaningful. The ensemble average of interest rates might tell you the expectation of interest rates over a class of instruments at a point in time. However, if you want to know the compound growth rate of a single instrument or portfolio, then you're going to need to use the geometric mean.
If product A grows by 20% and product B grows by 50%, what are you going to do with 1.2 and 1.5 exactly ? (1.2+1.5)/2 has what meaning ?
An alternate example is the ensemble average of all corporate bonds in a particular ETF. People who hold that ETF are very interested in this number, because it represents the interest rate that they're earning when they hold that basket of bonds.
In both examples they are also interested in the geometric (time averaged) growth rate as well, because that represents their steady state earnings over time. What they really care about, in both examples, is the time-averaged rate of the ensemble rates.
So you are averaging amounts of money, so you are averaging things that can be added and you are not averaging interest rates. So you're not doing what you think you were doing and everything is good. (1.2+1.5)/2 doesn't have a meaning but (1.2moneyA+1.5moneyB)/2=moneyAB and growth rate has nothing to do here
> because it represents the interest rate that they're earning when they hold that basket of bonds
No it doesn't. Look at my example, you would think that the arithmetic average growth rate is 1.35. But now if I told you product A is in fact made up of two subproducts, one is not growing (1) and the others is growing a lot (2), you would compute a new average of (1+2+1.5)/3=1.5
You're taking a weighted average of interest rates. You can call it an amount of money if you like, but you can also call it a weighted average of interest rates. This is no different from a weighted average of time-varying interest rates over irregular intervals of time.
One fruitful family of such 'distances' that lead to arithmetic mean, geometric mean, Holder's mean [1] and beyond etc is the Bregman divergence [0]. The sort of means that fall out from it have the form
f⁻¹ ( 1/n ∑ᵢ₌₁ⁿ f(xᵢ) ) where f is a smooth monotonically increasing function. By f⁻¹ I mean the inverse function, not the reciprocal.
[0] https://en.wikipedia.org/wiki/Bregman_divergence
(If one of a and b were fixed, it’d be way easier, that is, if f(a) = a + b, then g(a) = a - b is an inverse of f)
Edit:
I believe the author was trying to show (albeit incorrectly) the generalization of an arithmetic mean using f(x) = ax + b, with a = 1 and b = 2 (not f(a,b) as stated; plus the inverse function was applied incorrectly at the element level). The f-mean (Mf) is defined as:
Mf(x₁,...,xₙ) = f⁻¹( (1/n) ∑ₖⁿ f(xₖ) )
where the function f is injective and continuous. Different choices of f result in different means. This wikipedia article provides relevant details on the f-mean.