A risk-free return is the baseline return associated with an investment assumed to have no default or uncertainty risk. In practice, government security yields commonly approximate it, while black-swan events remain a qualification. section 7.6.1
Use the risk-free return as a comparison baseline:
- Subtract it from portfolio returns when calculating excess return in the Sharpe ratio. section 7.6.1
- Treat higher-risk assets as requiring higher expected returns than the risk-free baseline. section 7.6.1
- Do not substitute the stock market’s historical average for the risk-free return. section 7.6.1
Treasury yield versus dividend yield
A 10-year US Treasury yield of about 4.3% in June 2025 provided a risk-free-return benchmark, compared with Apple’s approximately 0.49% dividend yield. The comparison shows why dividend income alone may not compensate for inflation or equity risk. section 1.2.1
Listing 7.4 Creating a Markowitz efficient portfolio
risk_free_rate = 0.0422
for i in range(num_portfolios): #1
weights = np.random.dirichlet(np.ones(num_assets), size=1).flatten()
all_weights[i, :] = weights
port_returns[i] = np.dot(weights, mean_returns)
port_volatility[i] = np.sqrt(np.dot(weights.T,
np.dot(cov_matrix, weights)))
sharpe_ratios[i] = (port_returns[i] - risk_free_rate) / port_volatility[i]
#
max_sharpe_idx = np.argmax(sharpe_ratios) #2
optimal_weights = all_weights[max_sharpe_idx, :] #2
Insert a risk-free rate into portfolio analysis, calculate each portfolio’s Sharpe ratio, and select the simulated portfolio with the maximum value. section 7.6.1

