From fc4270fe7950576f29f8bc650862e65b2e72ca0f Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Thu, 19 Mar 2026 21:22:40 -0400 Subject: [PATCH 1/2] feat: add compounded flag to rar() for non-compounded returns --- quantstats/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantstats/stats.py b/quantstats/stats.py index 266f9513..76bc85b7 100644 --- a/quantstats/stats.py +++ b/quantstats/stats.py @@ -1582,7 +1582,7 @@ def rar(returns, rf=0.0): returns = _utils._prepare_returns(returns, rf) # Calculate CAGR and divide by exposure time - return cagr(returns) / exposure(returns) + return cagr(returns, compounded=compounded) / exposure(returns) def skew(returns, prepare_returns=True): From c4de649f74273a9a464312202da3077b5a0058af Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Thu, 19 Mar 2026 21:36:18 -0400 Subject: [PATCH 2/2] docs: update docstring for compounded parameter in rar() --- quantstats/stats.py | 1 + 1 file changed, 1 insertion(+) diff --git a/quantstats/stats.py b/quantstats/stats.py index 76bc85b7..1f9aae95 100644 --- a/quantstats/stats.py +++ b/quantstats/stats.py @@ -1569,6 +1569,7 @@ def rar(returns, rf=0.0): Args: returns (pd.Series): Return series to analyze rf (float): Risk-free rate (annualized, default: 0.0) + compounded (bool): Whether to compound returns for CAGR calculation (default: True) Returns: float: Risk-adjusted return