Simple Question Regarding Moving Product

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

kcaron
Posts: 101
Joined: Wed Mar 04, 2015 11:46 am

Simple Question Regarding Moving Product

Postby kcaron » Wed May 20, 2015 1:18 pm

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

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Simple Question Regarding Moving Product

Postby EViews Glenn » Wed May 20, 2015 1:33 pm

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.
Last edited by EViews Glenn on Wed May 20, 2015 2:17 pm, edited 1 time in total.

kcaron
Posts: 101
Joined: Wed Mar 04, 2015 11:46 am

Re: Simple Question Regarding Moving Product

Postby kcaron » Wed May 20, 2015 2:06 pm

Works perfectly! Thank you for the response... Made my day!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests