How can I get cumulative product with tomonthly

I have a time series object with daily returns e.g. 1%, 2%, -.5% etc...
I want to convert this to a monthly time series using the the cumulative product: 1.01 * 1.02*.995 etc...
However the only calcmethod I can see is CumSum which will obviously give slightly different answers.

2 Comments

Cumsum is a cumulative sum and does on calculate the cumulative product. I am not sure what you intend to do, can you give a short description? It seems that you should also weight the cumulative product somehow.
Suppose the daily returns are 1%, 2% 3%.
The monthly return should be 1.01*1.02*1.03 = 6.11%.
The return should not be 6% (which is what a cumulative sum would give).

Sign in to comment.

Answers (1)

Joseph Cheng
Joseph Cheng on 7 Apr 2014
Edited: Joseph Cheng on 7 Apr 2014
What you are describing isn't cumsum. you should be using prod() which will be the product of all the elements. cumsum is the cumulative sum which isn't what you are doing (you're multiplying)

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 1 Apr 2014

Edited:

on 7 Apr 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!