skfolio.measures.get_cumulative_returns#

skfolio.measures.get_cumulative_returns(returns, compounded=False, base=1.0)[source]#

Compute the cumulative returns from a series of returns.

Parameters:
returnsndarray of shape (n_observations,) or (n_observations, n_assets)

Array of return values.

compoundedbool, default=False

If True, compute compounded (geometric) cumulative returns as a wealth index starting at base. If False, compute non-compounded (arithmetic) cumulative returns starting at 0. Default is False.

basefloat, default=1.0

Starting value for compounded cumulative returns, expressed as a wealth index. For example, use 1.0 for a “wealth index” representing $1 invested, or 100.0 for index-style rebasing.

Returns:
values: ndarray of shape (n_observations,) or (n_observations, n_assets)

Cumulative returns.