How can I get cumulative product with tomonthly
Show older comments
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.
Answers (1)
Joseph Cheng
on 7 Apr 2014
Edited: Joseph Cheng
on 7 Apr 2014
0 votes
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
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!