Page 1 of 1

Product Series

Posted: Thu May 24, 2012 6:28 am
by VictorV
I'm having great difficulty building a series with interest rate r where I need the product from i=1 to t of ( 1+r_i ).
Using the comment @prod(x) gives just the total product of the whole series and not a new series where the entry at time t equals the product of the previous entries.
Could anyone help me out with this?
Thanks

Re: Product Series

Posted: Thu May 24, 2012 7:50 am
by EViews Gareth
You need the cumulative product? Take logs, use the cumulative sum, then exponentiate the result.

Something like:

Code: Select all

series prod = @exp(@cumsum(@log(r)))

Re: Product Series

Posted: Fri May 25, 2012 12:15 am
by VictorV
Thanks!