Introduction to Risk-Adjusted Returns
“Risk comes from not knowing what you’re doing.” — Warren Buffett. Most investors chase returns, but seasoned fund managers ask a different question: “Am I being rewarded fairly for the risks I’m taking?” This is where risk-adjusted returns come in. Over this two-part series, we will explore metrics that are more than just raw returns. In this part, we’ll start with the Treynor Ratio and implement it step by step using Python.
What is the Treynor Ratio?
The Treynor Ratio measures how much excess return (above the risk-free rate) a portfolio generates per unit of market risk (beta). The formula for the Treynor Ratio is:
$Treynor Ratio = frac{Excess Return}{Beta}$
Difference from Sharpe Ratio
- Sharpe uses standard deviation (total risk).
- Treynor uses beta (systematic risk).
Interpretation
- A higher Treynor Ratio means better compensation for market risk.
- Best used when comparing diversified portfolios or funds.
Python Implementation
Let’s bring this to life with an example of a real multi-national company ‘APPLE’.
Step 1: Importing Libraries
import pandas as pd
import numpy as np
import yfinance as yf
import statsmodels.api as sm
import matplotlib.pyplot as plt
import seaborn as sns
Step 2: Downloading and Loading Data
# Calculate daily returns from the 'Close' prices
portfolio_ticker = 'AAPL'
market_ticker = '^GSPC'
start_date = '2023-01-01'
end_date = '2024-01-01'
portfolio_data = yf.download(portfolio_ticker, start = start_date, end = end_date)
market_data = yf.download(market_ticker, start = start_date, end = end_date)
Step 3: Computing Stock Daily Returns
# Combine into single DataFrame
portfolio_returns = portfolio_data['Close'].pct_change().dropna()
market_returns = market_data['Close'].pct_change().dropna()
returns = pd.concat([portfolio_returns, market_returns], axis = 1)
returns.columns = ['AAPL', 'SP500']
returns = returns.dropna()
Step 4: Calculating Treynor Ratio
# Computation of Beta value
X = sm.add_constant(returns['SP500'])
y = returns['AAPL']
model = sm.OLS(y, X).fit()
beta = model.params['SP500']
print("Beta (Systematic Risk):", beta)
# Define Risk-free Rate (annualized, e.g., 3% U.S. T-bills)
rf = 0.03 / 252
# Calculate average excess return of portfolio
excess_return = returns['AAPL'].mean() - rf
# Computation of Treynor Ratio
treynor_ratio = excess_return / beta
print("Treynor Ratio:", treynor_ratio)
Understanding Beta
To understand beta better, let’s visualize it using a regression plot.
# Regression Plot (AAPL vs SP500)
plt.figure(figsize = (8,6))
sns.regplot(x = returns['SP500'], y = returns['AAPL'], line_kws = {'color':'red'})
plt.title("Regression of AAPL on S&P500 (Beta Estimation)")
plt.xlabel("S&P500 Daily Returns")
plt.ylabel("AAPL Daily Returns")
plt.grid(True)
plt.show()
Interpretation of Beta
- If the slope (β) = 1, AAPL moves in line with the market.
- If β > 1, AAPL is more volatile than the market (amplifies market movements).
- If β < 1, AAPL is less volatile than the market.
Conclusion
In this first part, we reviewed the Treynor Ratio, from its definition, use, and formula, to analyzing its application with a financial dataset. We saw its measures risk-adjusted returns in regards to systematic risk (beta), making it a viable metric for investors who are seeking to measure portfolio performance with respect to market movements, or risk factors. “Information is the oxygen of the modern age.” Similar to the life giving characteristic of oxygen, the information provides essentials for the decision-making process in finance. But information is not enough — we need to have tools that help us understand it, assess it and even compare it to other information. This is where performance ratios like the Sharpe Ratio and Treynor Ratio come in to the picture and ultimately bring focus and clarity to the cloudy decisions we are often making with investments.
FAQs
- What is the Treynor Ratio?
The Treynor Ratio is a financial metric that measures the excess return of a portfolio over the risk-free rate, relative to its systematic risk (beta). - How is the Treynor Ratio calculated?
The Treynor Ratio is calculated as the excess return of a portfolio divided by its beta. - What is beta in the context of the Treynor Ratio?
Beta, in the context of the Treynor Ratio, refers to the systematic risk or volatility of a portfolio relative to the overall market. - What is the difference between the Treynor Ratio and the Sharpe Ratio?
The main difference between the Treynor Ratio and the Sharpe Ratio is that the Treynor Ratio uses beta (systematic risk) as the risk measure, while the Sharpe Ratio uses standard deviation (total risk). - When is the Treynor Ratio more useful than the Sharpe Ratio?
The Treynor Ratio is more useful when comparing the performance of diversified portfolios or funds, as it focuses on systematic risk rather than total risk.









