Page 1 of 1

Simple Question Regarding Moving Product

Posted: Wed May 20, 2015 1:18 pm
by kcaron
I've got a series of numbers. Example 0.02, 0.03, 0.04, 0.05...

I need to be able to have a formula that does this:

((1+ 0.02) * (1 + 0.03) * (1 + 0.04) * (1+0.05)) - 1

The point is to get a return over the period.

The data is in a time series.
I'm using EViews 8

I need to be able to easily adjust the "window" over which the items are multiplied (sometimes I need the rolling 12 months, sometimes 36)...

I'm thinking that an @something function would work for this, but I can't figure it out.

Can someone please help me?

K

Re: Simple Question Regarding Moving Product

Posted: Wed May 20, 2015 1:33 pm
by EViews Glenn
Something like

Code: Select all

series z = @exp(@movsum(@log(1+x), 10)) - 1
should work. Note that the moving sum is backward, which you can adjust if necessary, by using leads.

Re: Simple Question Regarding Moving Product

Posted: Wed May 20, 2015 2:06 pm
by kcaron
Works perfectly! Thank you for the response... Made my day!