Solution - Compensated Risk

Contents

Solution - Compensated Risk#

Data#

Consider the excess return data in data/spx_returns_weekly.xlsx.

1.#

For each stock, calculate the (annualized) mean as well as the following measures of risk

  • volatility

  • skewness

  • 5th quantile return

  • max drawdown

  • correlation to SPY

For each risk measure, make a scatter plot of stocks risk on the horizontal axis and the stock’s mean return on the vertical axis.

2.#

Do any of these scatterplots show strong evidence of a relationship between risk and return?


1.1.#

import pandas as pd
import numpy as np

from cmds.portfolio import maximumDrawdown
INFILE = "../data/spx_returns_weekly.xlsx"
FREQ = 52

SHEET = 's&p500 rets'
rets = pd.read_excel(INFILE,sheet_name=SHEET).set_index('date')
SHEET = 'benchmark rets'
TICK = 'SPY'
TICK_RF = 'SHV'
facs = pd.read_excel(INFILE,sheet_name=SHEET).set_index('date')
spy = facs[[TICK]]
QUANTILE = .05

stats = pd.DataFrame(index=rets.columns,columns=['mean','vol','skewness','kurtosis','quantile','max drawdown'],dtype=float)
stats['mean'] = rets.mean() * FREQ
stats['vol'] = rets.std() * np.sqrt(FREQ)
stats['skewness'] = rets.skew()
stats['kurtosis'] = rets.kurtosis()
stats['quantile'] = rets.quantile(QUANTILE)
stats['max drawdown'] = maximumDrawdown(rets)['Max Drawdown']
stats[f'corr'] = pd.concat([rets,spy],axis=1).corr().loc['SPY']
for col in stats.columns[1:]:
    stats.plot.scatter(y='mean',x=col)
../_images/b5d3bb4839f6f642a0d15aaf795e571a0dd516bec6e47b52acb30371de28cdcf.png ../_images/f14650fb24a904e52dce9abce32f803ce448a12ac61f33189a5ac273892b08bf.png ../_images/a63c2aac7fe7b4ed3db883c5d8be59f452e477e21e472c0d24303cf771f94f9c.png ../_images/bdbb9744a63a61d84d901960781300fc5e7fd1030b41a4f49cfe37dc274b0973.png ../_images/5d1092ff4672276f00507aae8dc9a1cf2e9759b97fd56926deeb1bfd45b099ef.png ../_images/49021a4b45cf135529cbc79754d0256b8986d8e65fced8253eb532fc70022a26.png

1.2.#

None of the metrics show a strong proportional relationship to historic mean return.

This could indicate that…

  • historic mean or historic risk are not good indicators of the future.

  • there is some other risk metric which corresponds better to mean returns.

  • markets do not efficiently price risk: perhaps is no clear relationship between risk and return.

We will see further evidence for the first and second ideas in other discussions.