Skip to content

Commit 52e9b62

Browse files
rshefteltwiecki
authored andcommitted
Docstring cleanup for cum_returns (#82)
* Docstring cleanup for cum_returns * Docstring cleanup for cum_returns and remove Note
1 parent 623a9fa commit 52e9b62

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

empyrical/stats.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,8 @@ def cum_returns(returns, starting_value=0):
112112
pd.Series, np.ndarray, or pd.DataFrame
113113
Series of cumulative returns.
114114
115-
Note
116-
----
117-
For increased numerical accuracy, convert input to log returns
118-
where it is possible to sum instead of multiplying::
119115
120-
PI((1+r_i)) - 1 = exp(ln(PI(1+r_i))) # x = exp(ln(x))
121-
= exp(SIGMA(ln(1+r_i)) # ln(a*b) = ln(a) + ln(b)
122116
"""
123-
# df_price.pct_change() adds a nan in first position, we can use
124-
# that to have cum_logarithmic_returns start at the origin so that
125-
# df_cum.iloc[0] == starting_value
126-
# Note that we can't add that ourselves as we don't know which dt
127-
# to use.
128117

129118
if len(returns) < 1:
130119
return type(returns)([])

0 commit comments

Comments
 (0)