Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Risk-Adjusted Performance: Sharpe and Sortino Ratios | Risk Metrics and Uncertainty
R for Financial Analysts

bookRisk-Adjusted Performance: Sharpe and Sortino Ratios

When you evaluate investment performance, it's essential to consider not just the returns, but also the risks taken to achieve those returns. This is where risk-adjusted performance metrics come into play. Two of the most widely used metrics are the Sharpe ratio and the Sortino ratio. Both measure how much excess return you receive for the risk you take, but they differ in how they define and penalize risk.

  • The Sharpe ratio uses total volatility (standard deviation of returns) as its risk measure, treating upside and downside volatility equally;
  • The Sortino ratio focuses only on downside risk — volatility below a minimum acceptable return — making it more sensitive to harmful fluctuations that matter most to investors.

Understanding these differences helps you choose the most appropriate metric for your investment analysis.

12345678910111213141516171819
# Example: Calculate Sharpe ratio for a vector of returns in R # Assume 'returns' is a numeric vector of daily returns returns <- c(0.002, -0.001, 0.003, 0.004, -0.002, 0.001, 0.005) # Set risk-free rate (daily, for example 2% annualized) risk_free_rate <- 0.02 / 252 # Calculate excess returns excess_returns <- returns - risk_free_rate # Calculate mean and standard deviation of excess returns mean_excess <- mean(excess_returns) sd_excess <- sd(excess_returns) # Compute Sharpe ratio sharpe_ratio <- mean_excess / sd_excess print(sharpe_ratio)
copy

The output of the code above will be a single numeric value, the Sharpe ratio. A higher Sharpe ratio indicates better risk-adjusted performance. For example, if you see a Sharpe ratio of 1.2, it means that for each unit of risk (as measured by standard deviation), the asset delivers 1.2 units of excess return over the risk-free rate. Ratios above 1 are generally considered good, but interpretation always depends on the context and asset class.

1234567891011121314151617181920
# Example: Calculate Sortino ratio for the same returns # Assume 'returns' is a numeric vector of daily returns returns <- c(0.002, -0.001, 0.003, 0.004, -0.002, 0.001, 0.005) # Set risk-free rate (daily, for example 2% annualized) risk_free_rate <- 0.02 / 252 # Define minimum acceptable return (MAR), often set to risk-free rate mar <- risk_free_rate # Calculate downside deviation: only consider returns below MAR downside_returns <- returns[returns < mar] - mar downside_deviation <- sqrt(mean(downside_returns^2)) # Compute Sortino ratio mean_excess_sortino <- mean(returns - mar) sortino_ratio <- mean_excess_sortino / downside_deviation print(sortino_ratio)
copy

When you compare Sharpe and Sortino ratios for the same asset, you may notice that the Sortino ratio is often higher, especially if the asset's positive volatility outweighs its downside risk. This happens because the Sortino ratio ignores upside volatility, focusing only on negative deviations. If both ratios are similar, it suggests that most of the asset's volatility is on the downside. If the Sortino ratio is significantly higher, the asset's risk is mostly on the upside, which is generally favorable.

Note
Note

While Sharpe and Sortino ratios are powerful tools, they have pitfalls. Both ratios assume returns are normally distributed, but financial returns often have skewness or fat tails. This means extreme losses or gains may not be fully captured by standard deviation or downside deviation. Always examine the return distribution and use these ratios as part of a broader risk assessment.

question mark

Which statement best describes how the Sharpe ratio measures risk?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 4

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain when to use the Sharpe ratio versus the Sortino ratio?

What are some limitations of these risk-adjusted performance metrics?

How do I interpret a low Sharpe or Sortino ratio?

bookRisk-Adjusted Performance: Sharpe and Sortino Ratios

Deslize para mostrar o menu

When you evaluate investment performance, it's essential to consider not just the returns, but also the risks taken to achieve those returns. This is where risk-adjusted performance metrics come into play. Two of the most widely used metrics are the Sharpe ratio and the Sortino ratio. Both measure how much excess return you receive for the risk you take, but they differ in how they define and penalize risk.

  • The Sharpe ratio uses total volatility (standard deviation of returns) as its risk measure, treating upside and downside volatility equally;
  • The Sortino ratio focuses only on downside risk — volatility below a minimum acceptable return — making it more sensitive to harmful fluctuations that matter most to investors.

Understanding these differences helps you choose the most appropriate metric for your investment analysis.

12345678910111213141516171819
# Example: Calculate Sharpe ratio for a vector of returns in R # Assume 'returns' is a numeric vector of daily returns returns <- c(0.002, -0.001, 0.003, 0.004, -0.002, 0.001, 0.005) # Set risk-free rate (daily, for example 2% annualized) risk_free_rate <- 0.02 / 252 # Calculate excess returns excess_returns <- returns - risk_free_rate # Calculate mean and standard deviation of excess returns mean_excess <- mean(excess_returns) sd_excess <- sd(excess_returns) # Compute Sharpe ratio sharpe_ratio <- mean_excess / sd_excess print(sharpe_ratio)
copy

The output of the code above will be a single numeric value, the Sharpe ratio. A higher Sharpe ratio indicates better risk-adjusted performance. For example, if you see a Sharpe ratio of 1.2, it means that for each unit of risk (as measured by standard deviation), the asset delivers 1.2 units of excess return over the risk-free rate. Ratios above 1 are generally considered good, but interpretation always depends on the context and asset class.

1234567891011121314151617181920
# Example: Calculate Sortino ratio for the same returns # Assume 'returns' is a numeric vector of daily returns returns <- c(0.002, -0.001, 0.003, 0.004, -0.002, 0.001, 0.005) # Set risk-free rate (daily, for example 2% annualized) risk_free_rate <- 0.02 / 252 # Define minimum acceptable return (MAR), often set to risk-free rate mar <- risk_free_rate # Calculate downside deviation: only consider returns below MAR downside_returns <- returns[returns < mar] - mar downside_deviation <- sqrt(mean(downside_returns^2)) # Compute Sortino ratio mean_excess_sortino <- mean(returns - mar) sortino_ratio <- mean_excess_sortino / downside_deviation print(sortino_ratio)
copy

When you compare Sharpe and Sortino ratios for the same asset, you may notice that the Sortino ratio is often higher, especially if the asset's positive volatility outweighs its downside risk. This happens because the Sortino ratio ignores upside volatility, focusing only on negative deviations. If both ratios are similar, it suggests that most of the asset's volatility is on the downside. If the Sortino ratio is significantly higher, the asset's risk is mostly on the upside, which is generally favorable.

Note
Note

While Sharpe and Sortino ratios are powerful tools, they have pitfalls. Both ratios assume returns are normally distributed, but financial returns often have skewness or fat tails. This means extreme losses or gains may not be fully captured by standard deviation or downside deviation. Always examine the return distribution and use these ratios as part of a broader risk assessment.

question mark

Which statement best describes how the Sharpe ratio measures risk?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 4
some-alt