Page 1 of 1

Moving Average

Posted: Thu Jan 22, 2015 6:46 am
by Dominator
I would like to use a moving average of a series as an independent variable in an OLS equation but EViews does not seem to allow it. I can get around this by putting in a long hand calculation equal to the moving average but this is very cumbersome. Is there a way around this problem?

Re: Moving Average

Posted: Thu Jan 22, 2015 7:28 am
by startz

Code: Select all

@movav

Re: Moving Average

Posted: Thu Jan 22, 2015 12:55 pm
by Dominator
I was using mav rather movav. The difference seems to be that with mav the averages are not propagated and with movav they are propagated. Can you explain the meaning of this term in its EViews context?

Re: Moving Average

Posted: Thu Jan 22, 2015 1:02 pm
by EViews Gareth

Code: Select all

X = 3, NA, 2
@movav(x,3) = (3 + NA + 2)/3 = NA
@mav(x,3) = (3 + 2)/2 = 2.5

Re: Moving Average

Posted: Fri Mar 10, 2017 6:40 pm
by Econoforecast
EViews Gareth wrote:

Code: Select all

X = 3, NA, 2
@movav(x,3) = (3 + NA + 2)/3 = NA
@mav(x,3) = (3 + 2)/2 = 2.5

Hi Gareth,

Hope you're well.

I understand that in the above, x = the series I want to manipulate, and 3 is the fixed rolling window.

But how could I use the @MAV(x,3) function above to generate a series with an expanding rolling window? i.e. I'd like no restrictions, so the 3 shouldn't be there, rather it should be infinitity/unlimited.

Currently I can do fixed rolling moving average using the following series rtmovavgasx200=@mav(rtasx200,5) while this might still be satisfactory (I still need to confirm with my superior), I'd like to know how to do the expanding rolling window just in case. Any help appreciated. :D

Re: Moving Average

Posted: Fri Mar 10, 2017 7:30 pm
by EViews Gareth
I don't understand what an infinite moving average is.

Re: Moving Average

Posted: Fri Mar 10, 2017 9:40 pm
by Econoforecast
EViews Gareth wrote:I don't understand what an infinite moving average is.

I think I've fixed it. I simply changed the 5 above to 5,218 for the total number of observations. This way it's like a long term mean. This is what I needed, although I may yet not use it.

series rtmovavgasx200=@mav(rtasx200,5,218)

Thanks.

Re: Moving Average

Posted: Fri Mar 10, 2017 9:51 pm
by EViews Gareth

Re: Moving Average

Posted: Sat Mar 11, 2017 7:51 am
by Econoforecast
EViews Gareth wrote:http://www.eviews.com/help/helpintro.html#page/content%2Fmathapp-Cumulative_Statistic_Functions.html

Thanks. Works even better.