Generating a cumulative return series
Cumulative returns quantify the total change in the value of an investment over a specific period. To compute the cumulative return of a series of simple single-period returns, you need to add 1 to each return, then multiply these results together, and finally subtract 1 from the product. Recall the formula for the simple return:
R t =  P t − P t−1 _ P t−1 =  P t _ P t−1 − 1
Upon writing ( P t _ P t−2) = ( P t _ P t−1)( P t−1 _ P t−2), the two-period return can be expressed as follows:
R(2) = ( P t _ P t−1 )( P t−1 _ P t−2 ) − 1
= (1 + R t)(1 + R t−1) − 1
To compute the cumulative return of a series of continuously...