Rolling regression for Pool

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

coconut
Posts: 6
Joined: Mon Mar 21, 2016 9:31 am

Rolling regression for Pool

Postby coconut » Mon Mar 21, 2016 9:38 am

Hi there Gareth,

Is there are program out there that does this with Eviews 9.5?

I have 170 countries with a time series of 26 years, it's messy but has to be done.

Really appreciate some help.

Thanks,

Coconut

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

Re: Rolling regression for Pool

Postby EViews Gareth » Mon Mar 21, 2016 9:45 am

I don't know of any, but it should be relatively trivial to change one of the many rolling regression examples to work on a pool object rather than an equation object.

coconut
Posts: 6
Joined: Mon Mar 21, 2016 9:31 am

Re: Rolling regression for Pool

Postby coconut » Mon Mar 21, 2016 9:52 am

Gareth,

Cheers for your speedy reply. If it is so easy do you want give me an example? Not being funny but we are a small company and chose Eviews over other software as we thought it had a friendly interactive space, but there are things which may be obvious to you but not to me. The gesture of an example would be nice.

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

Re: Rolling regression for Pool

Postby EViews Gareth » Mon Mar 21, 2016 10:00 am


coconut
Posts: 6
Joined: Mon Mar 21, 2016 9:31 am

Re: Rolling regression for Pool

Postby coconut » Mon Mar 21, 2016 4:24 pm

Thanks Gareth really helpful programs. If I get stuck will let you know I am afraid

coconut
Posts: 6
Joined: Mon Mar 21, 2016 9:31 am

Rolling out of sample forecasts with pool

Postby coconut » Thu Mar 24, 2016 2:17 am

Hi Gareth,

I actually don't think what you have trivialised as easy is easy. I want out of sample forecasts with confidence intervals for over 145 countries. While I am aware that it is not your job to write programs I feel a bit of help and not trivialising a problem would be helpful. A few lines to convert a rolling program for an equation into a pool rolling would be very good PR. I am using Eviews and would like to recommend Eviews to my clients. Eviews is not only used by students and academics but should be used by businesses more.

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

Re: Rolling regression for Pool

Postby EViews Gareth » Thu Mar 24, 2016 4:16 am

Here's the first example given:

Code: Select all

'create some data create u 800 series y=nrnd series x1=nrnd series x2=nrnd series z=nrnd '------------------------------------------------------------------------------------- 'run rolling regression ' set window size !window = 20 ' set step size !step = 40 ' get size of workfile !length = @obsrange ' declare equation for estimation equation eq1 'calculate number of rolls !nrolls = @round((!length-!window)/!step) 'matrix to store coefficient estimates matrix(3,!nrolls) coefmat ' where 3 is the number of coefficients 'variable keeping track of how many rolls we've done !j=0 ' move sample !step obs at a time for !i = 1 to !length-!window+1-!step step !step !j=!j+1 ' set sample to estimation period smpl @first+!i-1 @first+!i+!window-2 ' estimate equation - where the equation is y=c(1) + c(2)*x1 + c(3)*x2 eq1.ls y c x1 x2 'store coefficients colplace(coefmat,eq1.@coefs,!j) next show coefmat

Here's that same example changed to be based on a pool:

Code: Select all

'create some data create u 800 for %i uk us ger fra jpn series y_{%i}=nrnd series x1_{%i}=nrnd series x2_{%i}=nrnd series z_{%i}=nrnd next '------------------------------------------------------------------------------------- 'run rolling regression ' set window size !window = 20 ' set step size !step = 40 ' get size of workfile !length = @obsrange ' declare equation for estimation pool eq1 uk us ger jpn fra 'calculate number of rolls !nrolls = @round((!length-!window)/!step) 'matrix to store coefficient estimates matrix(3,!nrolls) coefmat ' where 3 is the number of coefficients 'variable keeping track of how many rolls we've done !j=0 ' move sample !step obs at a time for !i = 1 to !length-!window+1-!step step !step !j=!j+1 ' set sample to estimation period smpl @first+!i-1 @first+!i+!window-2 ' estimate equation - where the equation is y=c(1) + c(2)*x1 + c(3)*x2 eq1.ls y_? c x1_? x2_? 'store coefficients colplace(coefmat,eq1.@coefs,!j) next show coefmat
As you can see, the changes really are quite trivial.

As an aside, the vast majority of our business is from the business world; academics are the minority.

coconut
Posts: 6
Joined: Mon Mar 21, 2016 9:31 am

Re: Rolling regression for Pool

Postby coconut » Thu Mar 24, 2016 4:26 am

Thanks Gareth,

You do a big service to Eview's PR with your surliness. Putting people down to make a point is really unprofessional. Well done Eviews!

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Rolling regression for Pool

Postby trubador » Thu Mar 24, 2016 12:06 pm

Your frustration at not being able to modify the code is understandable, but it is quite an unfair judgment against Gareth, who have posted nearly 10,000 replies to help requests of various users like yourself. I think you would appreciate the fact that the forum consists of a large community and is used very actively, which makes it virtually impossible for EViews' developers to meet all the demands in full. You can always do your own search in the forum and ask for help from other users.

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

Re: Rolling regression for Pool

Postby startz » Thu Mar 24, 2016 2:17 pm

The EViews team goes well above and beyond the call of duty. Unfortunately, the sometimes leads users to expect that tech support will do the users' jobs for them.

coconut
Posts: 6
Joined: Mon Mar 21, 2016 9:31 am

Re: Rolling regression for Pool

Postby coconut » Thu Mar 24, 2016 2:27 pm

Your replies are as expected but thank you. And frankly I am happy not to use this blog an further. From my experiences I won't recommend eviews but that's my personal view which I am entitled to.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests