Stocks to bonds RROI/B tutorial
Contents
Stocks to bonds RROI/B tutorial#
The RROI/B#
For each bond and a given dividend yield \(\delta\) we can calculate the corresponding RROI/B. Recall, this stands for the required return on investment relative to bond \(B\). The table with this column joined is returned by the function etbList_RROI()
. Unlike the functions we have considered so far, this function passes the dividend yield as a parameter.
Below we see the RROI for each bond at the dividend yield 3%
, or, 0.03
. Note, we display only the data of bonds and their RROI.
from functions import etbList_RROI
div_yield = 0.03 # div yield is zero for pure growth companies
etb_rroi = etbList_RROI(div_yld=div_yield)
etb_rroi[['ASX_code', f'RROI at {100 * div_yield}%']]
ASX_code | RROI at 3.0% | |
---|---|---|
0 | GSBG23 | 0% |
1 | GSBG24 | -1.73% |
2 | GSBU24 | -0.01% |
3 | GSBG25 | -1.72% |
4 | GSBU25 | 0.03% |
5 | GSBG26 | -2.03% |
6 | GSBQ26 | 0.58% |
7 | GSBG27 | -2.29% |
8 | GSBU27 | -1.02% |
9 | GSBI28 | -0.68% |
10 | GSBU28 | -0.97% |
11 | GSBG29 | -1.22% |
12 | GSBU29 | -0.81% |
13 | GSBI30 | -0.36% |
14 | GSBW30 | 0.36% |
15 | GSBK31 | -0.15% |
16 | GSBU31 | nan% |
17 | GSBI32 | 0.3% |
18 | GSBU32 | -0.1% |
19 | GSBG33 | -1.39% |
20 | GSBU33 | -0.78% |
21 | GSBI34 | -0.79% |
22 | GSBK35 | -0.44% |
23 | GSBG37 | -0.93% |
24 | GSBK39 | -0.48% |
25 | GSBI41 | -0.16% |
26 | GSBE47 | -0.36% |
27 | GSBK51 | 0.41% |
For a list of dividend yields#
To compare the RROI for a few dividend yields we can pass a list of yields to the function etbList_RROIs()
. Unlike etbList_RROI()
, the function etbList_RROIs()
passes a list type object.
from functions import etbList_RROIs
div_yields = [0.0, 0.01, 0.03, 0.05, 0.1]
etb_rrois = etbList_RROIs(div_ylds=div_yields)
rroi_cols = [ f"RROI at {100 *div_yld}%" for div_yld in div_yields ]
rroi_cols = ['ASX_code'] + rroi_cols
etb_rrois[rroi_cols]
ASX_code | RROI at 0.0% | RROI at 1.0% | RROI at 3.0% | RROI at 5.0% | RROI at 10.0% | |
---|---|---|---|---|---|---|
0 | GSBG23 | 0% | 0% | 0% | 0% | 0% |
1 | GSBG24 | 1.27% | 0.27% | -1.73% | -3.73% | -8.73% |
2 | GSBU24 | 2.94% | 1.96% | -0.01% | -1.99% | -6.91% |
3 | GSBG25 | 1.26% | 0.26% | -1.72% | -3.71% | -8.68% |
4 | GSBU25 | 2.95% | 1.97% | 0.03% | -1.91% | -6.75% |
5 | GSBG26 | 0.94% | -0.05% | -2.03% | -4.01% | -8.95% |
6 | GSBQ26 | nan% | nan% | nan% | nan% | nan% |
7 | GSBG27 | 0.68% | -0.31% | -2.29% | -4.27% | -9.21% |
8 | GSBU27 | 1.87% | 0.91% | -1.02% | -2.94% | -7.7% |
9 | GSBI28 | 2.19% | 1.23% | -0.68% | -2.59% | -7.32% |
10 | GSBU28 | 1.89% | 0.93% | -0.97% | -2.87% | -7.56% |
11 | GSBG29 | 1.66% | 0.7% | -1.22% | -3.13% | -7.85% |
12 | GSBU29 | 2.02% | 1.07% | -0.81% | -2.67% | -7.27% |
13 | GSBI30 | 2.44% | 1.5% | -0.36% | -2.2% | -6.72% |
14 | GSBW30 | 3.07% | 2.16% | 0.36% | -1.42% | -5.74% |
15 | GSBK31 | 2.6% | 1.68% | -0.15% | -1.95% | -6.35% |
16 | GSBU31 | 3.06% | 2.16% | 0.39% | -1.36% | -5.58% |
17 | GSBI32 | 2.98% | 2.08% | 0.3% | -1.46% | -5.68% |
18 | GSBU32 | 2.58% | 1.68% | -0.1% | -1.86% | -6.04% |
19 | GSBG33 | 1.42% | 0.48% | -1.39% | -3.23% | -7.69% |
20 | GSBU33 | 1.94% | 1.03% | -0.78% | -2.55% | -6.77% |
21 | GSBI34 | 1.94% | 1.02% | -0.79% | -2.56% | -6.78% |
22 | GSBK35 | 2.22% | 1.32% | -0.44% | -2.17% | -6.21% |
23 | GSBG37 | 1.74% | 0.84% | -0.93% | -2.65% | -6.6% |
24 | GSBK39 | 2.1% | 1.23% | -0.48% | -2.11% | -5.73% |
25 | GSBI41 | 2.34% | 1.49% | -0.16% | -1.72% | -5.07% |
26 | GSBE47 | 2.05% | 1.22% | -0.36% | -1.81% | -4.61% |
27 | GSBK51 | 2.65% | 1.87% | 0.41% | -0.9% | -3.38% |
Bond adjusted price-to-earnings#
For a particular bond and stock, passing their codes into the function etbAdj_PE()
returns the stock’s bond adjusted price-earnings ratio and corresponding excess. Omitting the bond code and passing just the stock code to the function etbListAdj_PE()
returns a pandas dataframe of bond adjusted price-earnings and excess against each bond currently issued by the Australian Government.
We see below results for the Commonwealth Bank of Australia, CBA.AX
.
from functions import etbListAdj_PE
stock_code = 'CBA.AX'
adj_PEs = etbListAdj_PE(stock_code)
adj_PEs
ASX_code | CBA.AX RROI/B at 3.85% | CBA.AX_adjused PE | CBA.AX excess | |
---|---|---|---|---|
0 | GSBG23 | 0% | 19.060000 | -19.060000 |
1 | GSBG24 | -2.58% | 25.876280 | -24.876280 |
2 | GSBU24 | -0.85% | 20.707654 | -18.707654 |
3 | GSBG25 | -2.57% | 25.839332 | -23.839332 |
4 | GSBU25 | -0.79% | 25.226353 | -22.226353 |
5 | GSBG26 | -2.87% | 36.906933 | -33.906933 |
6 | GSBQ26 | nan% | 23.581854 | -20.581854 |
7 | GSBG27 | -3.13% | 39.891996 | -35.891996 |
8 | GSBU27 | -1.83% | 29.517576 | -24.517576 |
9 | GSBI28 | -1.49% | 27.871376 | -22.871376 |
10 | GSBU28 | -1.78% | 29.240686 | -23.240686 |
11 | GSBG29 | -2.03% | 30.587654 | -24.587654 |
12 | GSBU29 | -1.6% | 28.385405 | -21.385405 |
13 | GSBI30 | -1.14% | 26.460301 | -19.460301 |
14 | GSBW30 | -0.4% | 24.023346 | -16.023346 |
15 | GSBK31 | -0.92% | 25.654482 | -17.654482 |
16 | GSBU31 | -0.36% | 23.916676 | -14.916676 |
17 | GSBI32 | -0.45% | 24.178646 | -15.178646 |
18 | GSBU32 | -0.85% | 25.431402 | -15.431402 |
19 | GSBG33 | -2.17% | 31.431540 | -21.431540 |
20 | GSBU33 | -1.54% | 28.093995 | -17.093995 |
21 | GSBI34 | nan% | 28.128210 | -17.128210 |
22 | GSBK35 | -1.18% | 26.618017 | -14.618017 |
23 | GSBG37 | -1.67% | 28.703953 | -14.703953 |
24 | GSBK39 | -1.18% | 26.603922 | -10.603922 |
25 | GSBI41 | -0.83% | 25.363909 | -7.363909 |
26 | GSBE47 | -0.99% | 25.923066 | -1.923066 |
27 | GSBK51 | -0.17% | 23.389677 | 4.610323 |