12 ms·
> standing at the mean minimizes the average squared distance This is true, but I find it more intuitive to think about the signed distance: if you define sign
by hddqsb 4y ago
> standing at the mean minimizes the average squared distance
This is true, but I find it more intuitive to think about the signed distance: if you define signed_dist(x, y) = x - y, then the mean is the value that makes the average signed distance closest to 0. Of course in reality distance is unsigned – if you walk 1m left then 1m right, you've walked 1m + 1m = 2m, not 1m + -1m = 0m, so the signed distance is not appropriate.
Here is a practical example where the aim is to get the average signed difference to be closest to 0: You want to count a large number of nails by weighing them. To do that, you need to know the weight of a single nail. But the nails have slightly different weights, so you need to pick some representative value. Question: Should you pick the mean or the median? Answer: You should pick the mean, because when you weigh all the nails together the differences will cancel out.
So the rule is:
- To minimise the average value of the absolute difference, pick the median.
- To minimise the absolute value of the average difference, pick the mean.
- thaumasiotes 4y ago> But the nails have slightly different weights, so you need to pick some representative value. Question: Should you pick the mean or the median? Answer: You should pick the mean, because when you weigh all the nails together the differences will cancel out. Well, yes, that is the definition of the mean. But you can't know what the mean is without having already answered your original question of "how many nails are there?", so as a formal matter this is completely useless advice. What you actually want to do is pick out a number of nails that you do know exactly, say 10, weigh them, and use the mean weight of that sample to estimate the mean weight of the entire supply of nails.
- hddqsb 4y ago> But you can't know what the mean is without having already answered your original question of "how many nails are there?", so as a formal matter this is completely useless advice. Yes, obviously you'd estimate the mean/median by taking a small sample (or using a published value). I left that detail out because it's not relevant to the choice between mean and median.
- thaumasiotes 4y agoI still don't really see the point of the observation. It's weird to say "You should pick the mean, because when you weigh all the nails together the differences will cancel out". That's true because the mean is defined as the value that achieves that result. It's like answering the Monty Hall problem by saying "you should pick the door with a car behind it, because that door has a car behind it". You're asking what the mean weight of a bundle of nails is and then pointing out that the mean weight is a better estimate of the mean weight than the median weight is. Why is that worth noting?
- hddqsb 4y agoI was trying to come up with a scenario where you have to choose between the mean and the median, and the correct choice is the mean due to signedness (in contrast with the elevator example, where the correct choice is the median because the distance is unsigned). Do you have a better example? It should be obvious that the mean is the correct representative value for weighing nails. My point is that there are cases that call for the mean and cases that call for the median, and the distinction can be explained by considering the signedness (without having to consider squared distances). Maybe the following variation on the nail example would help: Suppose the manufacturer of the nails must publish a reference value for the weight of a nail, and will be fined for every nail that is not exactly the correct weight. The fine is proportional to the absolute error. Question: Should the manufacturer publish the mean or the median in order to minimise fines? Answer: The median. Why is the mean the correct representative value for counting nails, but not for minimising fines? I'm arguing that it's because when the nails are weighed together the errors are signed, but when the fines are calculated the errors are unsigned (in the same way that the distances to the elevators are unsigned).
- thaumasiotes 4y agoIt is an interesting example, but after some thought it's basically identical to the elevator example. It is so similar that I have some doubts about whether I could correctly extrapolate a principle based on those two examples. > Why is the mean the correct representative value for counting nails, but not for minimising fines? I'm arguing that it's because when the nails are weighed together the errors are signed, but when the fines are calculated the errors are unsigned (in the same way that the distances to the elevators are unsigned). And here, there are two points that bother me. First, the mean is the correct representative for counting nails because that's how it's defined. A mean is just the answer to any question of the form "if all of these data points were equal to each other, what is the value they would all share?". That's the question you're asking about the weight of the nails. Second, I find it difficult to believe in your stated explanation of why you might choose the mean over the median (or vice versa), because we've already observed that the mean minimizes the sum of squared errors, and squared errors are all unsigned. You're relying on the assumption that, in the above example, the fine (which should be minimized) is directly proportional to difference from the estimate. But that assumption doesn't appear in the explanation of why one metric or the other will minimize the fine.