<p>As explained in <a href="https://math.stackexchange.com/a/2838900">this math.stackexchange answer</a>, the discrepancy can be understood as an instance of the <a href="https://en.wikipedia.org/wiki/Inequality_of_arithmetic_and_geometric_means#The_inequality" rel="nofollow noreferrer">inequality of arithmetic and geometric means</a> (and also as an instance of <a href="https://en.wikipedia.org/wiki/Jensen%27s_inequality" rel="nofollow noreferrer">Jensen's inequality</a>). It's a generic issue when one is using logarithms. The inequality can be expressed as</p>
<p><span class="math-container">$(x_{1} x_{2} \ldots x_{n})^{1/n} \leq \frac{x_{1} + \cdots + x_{n}}{n}$</span></p>
<p>and if you take the log of both sides, you get</p>
<p><span class="math-container">$(1/n)(\log x_{1} + \cdots + \log x_{n})) \leq \log ((1/n)(x_{1} + \cdots + x_{n}))$</span></p>
<p>So the mean of the logarithmic quantities (e.g., colors = log of flux ratios) will always be <span class="math-container">$&lt;$</span> the log of the mean of the input values (e.g., flux ratios), unless all the values are identical.</p>
<p>To see why you want to do the averaging <em>before</em> taking the logarithms, imagine a scenario where you want to find the average brightness of some group of measurements. Assume the measurements have a well-defined true mean and a symmetric Gaussian distribution, say mean = 100 and dispersion <span class="math-container">$\sigma = 20$</span>. If you have two measurements at <span class="math-container">$\pm \sigma$</span> -- e.g., 80 and 120 -- then their mean will be 100, which is the correct value. The base-10 log of that value will be 2.0. But if you take the log first and <em>then</em> average, you will get <span class="math-container">$(1.90309 + 2.07918)/2 = 1.991$</span>, which is the wrong answer.</p>
<p>In your case, the quantity you're taking the log of is the flux ratio, so you want to average those values first, before computing the color value from that.</p>

CC BY-SA 4.0
2021-08-07T11:00:54.173Z
2021-08-07T11:00:54.173Z
Peter Erwin
<p>Say we're given a set of flux measurements in two filters for a group of <span class="math-container">$n$</span> stars, say H-band and K-band: <span class="math-container">$F_H$</span> and <span class="math-container">$F_K$</span></p>
<p>From these, we can compute a color in <span class="math-container">$\Delta m$</span> for each of the <span class="math-container">$n$</span> stars, e.g.</p>
<p><span class="math-container">$(H-K) = 2.5 \log_{10}(F_K/F_H)$</span></p>
<p>If we wanted to determine the mean color of the stars in this set, what is the proper way to proceed?</p>
<p>i.e. should we:</p>
<p>a) compute the mean of the <span class="math-container">$\Delta m$</span> measurements (i.e. <span class="math-container">$H-K$</span>), or</p>
<p>b) compute the mean of the flux ratio measurements (<span class="math-container">$F_K/F_H$</span>), then convert to <span class="math-container">$\Delta m$</span>?</p>
<p>My intuition is the former, but I've been told the answer is the latter...</p>
<p>My thinking, using a very simple example in which we have two stars:</p>
<p>For star 1, we measure:</p>
<p><span class="math-container">$F_H = 2$</span></p>
<p><span class="math-container">$F_K = 1$</span></p>
<p>So:</p>
<p><span class="math-container">$F_H / F_K = 2$</span>, or</p>
<p><span class="math-container">$(H-K) = -0.753$</span></p>
<p>For star 2, we measure:</p>
<p><span class="math-container">$F_H = 1$</span></p>
<p><span class="math-container">$F_K = 2$</span></p>
<p>So:</p>
<p><span class="math-container">$F_H/ F_K = 0.5$</span></p>
<p><span class="math-container">$(H-K) = 0.753$</span></p>
<p>If we average these two measurements in flux space, we find an average color of:</p>
<p><span class="math-container">$(2+0.5)/2 = 1.25$</span>, or <span class="math-container">$F_H = 1.25 \cdot F_K$</span>, or <span class="math-container">$F_H &gt; F_K$</span> <span class="math-container">$\rightarrow$</span> an average <span class="math-container">$\textbf{blue}$</span> color</p>
<p>Or in magnitude space:</p>
<p><span class="math-container">$(–0.753 + 0.753) / 2 = 0$</span> or <span class="math-container">$H = K$</span> <span class="math-container">$\rightarrow$</span> a gray color</p>
<p>Notably... the magnitude average is robust to inversion, but the flux ratio average is not:</p>
<p>Measurement 1: <span class="math-container">$F_K / F_H = 0.5, \Delta(K-H) = 0.753$</span></p>
<p>Measurement 2: <span class="math-container">$F_K / F_H = 2.0, \Delta(K-H) = –0.753$</span></p>
<p>Flux average: <span class="math-container">$F_K / F_H = 1.25$</span>, <span class="math-container">$F_K = 1.25 \cdot F_H$</span>, or <span class="math-container">$F_K &gt; F_H$</span> <span class="math-container">$\rightarrow$</span> an average <span class="math-container">$\textbf{red}$</span> color</p>
<p>While the mag average is again 0.</p>
<p>Any insights or suggested reading would be much appreciated!</p>

CC BY-SA 4.0
2021-08-05T19:43:22.817Z
a third possibility could by to take the average of $F_K$, the average of $F_H$, then divide them and convert in magnitude. This one would have the advantage of coinciding with the color you would obtain if the stars weren't resolved
Prallax
CC BY-SA 4.0
2021-08-06T07:38:34.043Z
I am not a specialist at all but I think one should average at the point closest as possible to what is actually measured.
Alchimista
CC BY-SA 4.0
2021-08-06T11:46:50.923Z
Correct would be calculating average of each F independently, than putting them to one solution (e.g. conversion, as it suggested by Prallax.
Lariliss
CC BY-SA 4.0
2021-08-06T14:58:16.633Z
@Prallax Thank you for your response! Would this not be an entirely different measurement than the one discussed? Say we have 3 stars now, with $F_H = [6, 2, 50]$, $F_K = [3, 1, 100]$. Taking the individual colors, we find $(H-K) = [-0.75, -0.75, 0.75]$. I would say that -- on average, these stars are blue. But averaging the fluxes would give us $\bar{F}_H = 19.3$, $\bar{F}_K = 34.7$, for $\bar{(H-K)} =0.63$, a definitively red color. Of course, the total collection of the light of the stars would indeed be red. But is it fair to say that the individual stars are?
leo_africanus
CC BY-SA 4.0
2021-08-07T01:54:30.613Z
@leo_africanus You’re correct; Prallax’s suggestion is not what you want.
Peter Erwin
<observational-astronomy><magnitude>
Proper way to average a set of color measurements?
leo_africanus
# Proper way to average a set of color measurements?

(Asked by: username_0 on 2021-08-05)

Say we're given a set of flux measurements in two filters for a group of $n$ stars, say H-band and K-band: $F\_H$ and $F\_K$

From these, we can compute a color in $\Delta m$ for each of the $n$ stars, e.g.

$(H-K) = 2.5 \log\_{10}(F\_K/F\_H)$

If we wanted to determine the mean color of the stars in this set, what is the proper way to proceed?

i.e. should we:

a) compute the mean of the $\Delta m$ measurements (i.e. $H-K$), or

b) compute the mean of the flux ratio measurements ($F\_K/F\_H$), then convert to $\Delta m$?

My intuition is the former, but I've been told the answer is the latter...

My thinking, using a very simple example in which we have two stars:

For star 1, we measure:

$F\_H = 2$

$F\_K = 1$

So:

$F\_H / F\_K = 2$, or

$(H-K) = -0.753$

For star 2, we measure:

$F\_H = 1$

$F\_K = 2$

So:

$F\_H/ F\_K = 0.5$

$(H-K) = 0.753$

If we average these two measurements in flux space, we find an average color of:

$(2+0.5)/2 = 1.25$, or $F\_H = 1.25 \cdot F\_K$, or $F\_H > F\_K$ $\rightarrow$ an average $\textbf{blue}$ color

Or in magnitude space:

$(–0.753 + 0.753) / 2 = 0$ or $H = K$ $\rightarrow$ a gray color

Notably... the magnitude average is robust to inversion, but the flux ratio average is not:

Measurement 1: $F\_K / F\_H = 0.5, \Delta(K-H) = 0.753$

Measurement 2: $F\_K / F\_H = 2.0, \Delta(K-H) = –0.753$

Flux average: $F\_K / F\_H = 1.25$, $F\_K = 1.25 \cdot F\_H$, or $F\_K > F\_H$ $\rightarrow$ an average $\textbf{red}$ color

While the mag average is again 0.

Any insights or suggested reading would be much appreciated!

**Tags:** observational-astronomy, magnitude

> **Comments:**
> **username_1**: a third possibility could by to take the average of $F_K$, the average of $F_H$, then divide them and convert in magnitude. This one would have the advantage of coinciding with the color you would obtain if the stars weren't resolved  
> **username_2**: I am not a specialist at all but I think one should average at the point closest as possible to what is actually measured.  
> **username_3**: Correct would be calculating average of each F independently, than putting them to one solution (e.g. conversion, as it suggested by username_1.  
> **username_0**: @username_1 Thank you for your response! Would this not be an entirely different measurement than the one discussed? Say we have 3 stars now, with $F_H = [6, 2, 50]$, $F_K = [3, 1, 100]$. Taking the individual colors, we find $(H-K) = [-0.75, -0.75, 0.75]$. I would say that -- on average, these stars are blue. But averaging the fluxes would give us $\bar{F}_H = 19.3$, $\bar{F}_K = 34.7$, for $\bar{(H-K)} =0.63$, a definitively red color. Of course, the total collection of the light of the stars would indeed be red. But is it fair to say that the individual stars are?  
> **username_4**: @username_0 You’re correct; username_1’s suggestion is not what you want.  

---

## 1 answers

### Answer by username_4 on 2021-08-07. Score: 1 | Accepted answer

As explained in [this math.stackexchange answer](https://math.stackexchange.com/a/2838900), the discrepancy can be understood as an instance of the [inequality of arithmetic and geometric means](https://en.wikipedia.org/wiki/Inequality_of_arithmetic_and_geometric_means#The_inequality) (and also as an instance of [Jensen's inequality](https://en.wikipedia.org/wiki/Jensen%27s_inequality)). It's a generic issue when one is using logarithms. The inequality can be expressed as

$(x\_{1} x\_{2} \ldots x\_{n})^{1/n} \leq \frac{x\_{1} + \cdots + x\_{n}}{n}$

and if you take the log of both sides, you get

$(1/n)(\log x\_{1} + \cdots + \log x\_{n})) \leq \log ((1/n)(x\_{1} + \cdots + x\_{n}))$

So the mean of the logarithmic quantities (e.g., colors = log of flux ratios) will always be $<$ the log of the mean of the input values (e.g., flux ratios), unless all the values are identical.

To see why you want to do the averaging *before* taking the logarithms, imagine a scenario where you want to find the average brightness of some group of measurements. Assume the measurements have a well-defined true mean and a symmetric Gaussian distribution, say mean = 100 and dispersion $\sigma = 20$. If you have two measurements at $\pm \sigma$ -- e.g., 80 and 120 -- then their mean will be 100, which is the correct value. The base-10 log of that value will be 2.0. But if you take the log first and *then* average, you will get $(1.90309 + 2.07918)/2 = 1.991$, which is the wrong answer.

In your case, the quantity you're taking the log of is the flux ratio, so you want to average those values first, before computing the color value from that.


---

