Moving Average

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

Dominator
Posts: 10
Joined: Fri May 23, 2014 4:54 am

Moving Average

Postby Dominator » Thu Jan 22, 2015 6:46 am

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?

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Moving Average

Postby startz » Thu Jan 22, 2015 7:28 am

Code: Select all

@movav

Dominator
Posts: 10
Joined: Fri May 23, 2014 4:54 am

Re: Moving Average

Postby Dominator » Thu Jan 22, 2015 12:55 pm

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?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: Moving Average

Postby EViews Gareth » Thu Jan 22, 2015 1:02 pm

Code: Select all

X = 3, NA, 2
@movav(x,3) = (3 + NA + 2)/3 = NA
@mav(x,3) = (3 + 2)/2 = 2.5
Follow us on Twitter @IHSEViews

Econoforecast
Posts: 25
Joined: Sun Feb 19, 2017 1:25 pm

Re: Moving Average

Postby Econoforecast » Fri Mar 10, 2017 6:40 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: Moving Average

Postby EViews Gareth » Fri Mar 10, 2017 7:30 pm

I don't understand what an infinite moving average is.
Follow us on Twitter @IHSEViews

Econoforecast
Posts: 25
Joined: Sun Feb 19, 2017 1:25 pm

Re: Moving Average

Postby Econoforecast » Fri Mar 10, 2017 9:40 pm

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: Moving Average

Postby EViews Gareth » Fri Mar 10, 2017 9:51 pm

Follow us on Twitter @IHSEViews

Econoforecast
Posts: 25
Joined: Sun Feb 19, 2017 1:25 pm

Re: Moving Average

Postby Econoforecast » Sat Mar 11, 2017 7:51 am

EViews Gareth wrote:http://www.eviews.com/help/helpintro.html#page/content%2Fmathapp-Cumulative_Statistic_Functions.html

Thanks. Works even better.


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 7 guests