Over the years, I've coded all sorts of little routines to simplify and automate various financial calculations.
Going through some papers the other day, I found some (very rough) pseudo-code for an idea I had back when I was writing regular TMF articles, rather than the bi-monthly 'Collectives' that I do for the site now.
Briefly, I wanted a way to compare two percentage growth rates, so as to be able to say something like "Over the last year, Company X has outperformed the FTSE by Y%".
Company X = +9.91% growth, FTSE = -8.03% growth (ie, negative growth).
Company X = 109.91, FTSE = 91.97, so difference = 17.94.
17.94/ 91.97 = 19.506%
In other words, Company X has outperformed the FTSE by 19.506%.
The reason for posting is that I'm always slightly cautious about comparing percentages, hence the step of turning them into absolute values, eg 109.91 and 91.97. And I also recall the tangles Luni got into with his percentage inflation calculations, which a number of people (myself included) thought were flawed.
So I'd appreciate a second opinion (or two!). Is this calculation conceptually valid?
MDW1954
Fun with percentages
-
- Lemon Slice
- Posts: 881
- Joined: November 4th, 2016, 1:12 pm
Re: Fun with percentages
But by using 91.97 as the denominator, you are using the value at period end. I would have thought that you wanted to use the value at period start.MDW1954 wrote: Company X = 109.91, FTSE = 91.97, so difference = 17.94.
17.94/ 91.97 = 19.506%
In other words, Company X has outperformed the FTSE by 19.506%.
MDW1954
So 100 in FTSE, left with 91.97; 100 in X, left with 109.91. I'd go for the outperformance being 17.94%, as the amount by which an initial investment in X of 100 outperformed an initial investment of 100 in the FTSE.
-
- Lemon Quarter
- Posts: 2943
- Joined: November 5th, 2016, 2:22 am
Re: Fun with percentages
The calculation seems valid: in your example, holders of a FTSE tracker would need a 19.5% increase in value in order to draw level with company X again.
I think you can skip the calculation of the difference (17.94) as you get the same result just by dividing the two % values directly (1-(109.91/91.97)).
There is a risk that people will see it as a flawed calculation: dividing a "winner" by a "loser" makes the winner stand out even more. The winner did not give its holder a 19.5% return, but a 9.9% one. The context of the % needs to be very explicit!
VRD
I think you can skip the calculation of the difference (17.94) as you get the same result just by dividing the two % values directly (1-(109.91/91.97)).
There is a risk that people will see it as a flawed calculation: dividing a "winner" by a "loser" makes the winner stand out even more. The winner did not give its holder a 19.5% return, but a 9.9% one. The context of the % needs to be very explicit!
VRD
-
- Lemon Half
- Posts: 6209
- Joined: November 4th, 2016, 11:24 am
Re: Fun with percentages
Yes, had you invested in company X you'd now have 19.506% more than you'd now have if you'd invested in the FTSE instead, so it's absolutely the correct way of looking at it.MDW1954 wrote:The reason for posting is that I'm always slightly cautious about comparing percentages, hence the step of turning them into absolute values, eg 109.91 and 91.97. And I also recall the tangles Luni got into with his percentage inflation calculations, which a number of people (myself included) thought were flawed.
So I'd appreciate a second opinion (or two!). Is this calculation conceptually valid?
I would add though that it's not a figure to look at in isolation, as some fund managers seem to like to do: "This year we had a stellar performance with our fund outperforming the FTSE by 19.5%!" (Fund -12%, FTSE -26.4%)
Doing as you did, and normalizing the amounts (or turning then into actual £ amounts), helps avoid the error that Luni (and others) made/make of simply subtracting percentages from each other. (It's just a shame that, despite being told it was wrong numerous times, by me, you and many others, Luni ignored that and carried on subtracting...)
-
- Lemon Quarter
- Posts: 2223
- Joined: November 4th, 2016, 8:46 pm
Re: Fun with percentages
Thanks, all. That's reassuring. I'll think I'll finally take the next step and turn it from pseudo-code to real code!
MDW1954
MDW1954
-
- Lemon Slice
- Posts: 563
- Joined: November 4th, 2016, 3:46 pm
Re: Fun with percentages
Yes, you want the relative return from a growth of X% compared to one of Y%, ie (1+X)/(1+Y) which should then be converted to a growth rate by subtracting 1. So the calculation you need is ((1+X)/(1+Y))-1.MDW1954 wrote: Company X = +9.91% growth, FTSE = -8.03% growth (ie, negative growth).
Company X = 109.91, FTSE = 91.97, so difference = 17.94.
17.94/ 91.97 = 19.506%
In other words, Company X has outperformed the FTSE by 19.506%.
Is this calculation conceptually valid?
MDW1954
You have calculated (100X-100Y)/(100+100Y).
Now (100X-100Y)/(100+100Y) = (X-Y)/(1+Y) = ((1+X)-(1+Y))/(1+Y) = ((1+X)/(1+Y))-1
So you have calculated what you need. QED
-
- Lemon Quarter
- Posts: 2223
- Joined: November 4th, 2016, 8:46 pm
Re: Fun with percentages
Thanks, modellingman.modellingman wrote:Yes, you want the relative return from a growth of X% compared to one of Y%, ie (1+X)/(1+Y) which should then be converted to a growth rate by subtracting 1. So the calculation you need is ((1+X)/(1+Y))-1.MDW1954 wrote: Company X = +9.91% growth, FTSE = -8.03% growth (ie, negative growth).
Company X = 109.91, FTSE = 91.97, so difference = 17.94.
17.94/ 91.97 = 19.506%
In other words, Company X has outperformed the FTSE by 19.506%.
Is this calculation conceptually valid?
MDW1954
You have calculated (100X-100Y)/(100+100Y).
Now (100X-100Y)/(100+100Y) = (X-Y)/(1+Y) = ((1+X)-(1+Y))/(1+Y) = ((1+X)/(1+Y))-1
So you have calculated what you need. QED
I recall you advising me on a percentage calculation in 1977, and here you are doing the same 40 years on!
This time round, I was happy with the maths, but seeking validation of the concept.
Best wishes,
MDW1954