Why do we use harmoic mean for calculating the avg cost of shares purchased over time? I don’t understand the intuition. I am unable to comprehend the potential strength that lies in the harmonic mean.
To calculate the average cost per share, we need to know the total amount spent, and the total number of shares purchased.
The total cost is the number of purchases (n) times the currency amount per purchase (C). The number of shares purchased at price P1 is C/P1; the number of shares purchased at price P2 is C/P2: and so on. The total number of shares is:
C/P1 + C/P2 + . . . + C/Pn = C × (1/P1 + 1/P2 + . . . + 1/Pn)
Thus, the average price per share is:
nC / (C/P1 + C/P2 + . . . + C/Pn)
= nC / [C × (1/P1 + 1/P2 + . . . + 1/Pn)]
= n / (1/P1 + 1/P2 + . . . + 1/Pn)
which is the harmonic mean of P1, P2, . . ., Pn.
(Note that this works only when you buy the same currency amount every time. If you buy, say, the same number of shares each time, the average price per share is just the arithmetic mean of the prices you paid.)
I was looking for this. Thanks a lot. So, this is where HM comes in. Nice.
My pleasure.