Finding the correct combination of lags for forecasting

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

marcounam
Posts: 49
Joined: Tue Jan 11, 2011 10:42 am

Finding the correct combination of lags for forecasting

Postby marcounam » Tue Jun 21, 2011 10:52 am

Hello:

I have the following problem:

I have two series of dependent variables and nine series of independent variables. I need to do the following: For each series of dependent variables find the best ten equations of (any)five series of the nine independent variables where each series of independent variables can have a lag of up to 3 years. The major problem i have is that i would like some type of "for loop" that would do the following : "for every possible sub-group of 5 independent series out of the nine possible independent series" run the regressions over all possible combination of lags. I have code that given a sub-group of five independent series runs the regressions over all possible combinations of lags of these 5 series. What i dont have is code that loops through all the sub-groups of five series out of the nine possible series. Could this be done?

Many Thanks for your time.

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

Re: Finding the correct combination of lags for forecasting

Postby EViews Gareth » Tue Jun 21, 2011 10:56 am

Not quite sure I understand the question. Yes, it is possible to write a for loop that loops through your variables, building groups of 5. It seems to me it would be quite similar to the loop you've already written that does the lag combinations.

marcounam
Posts: 49
Joined: Tue Jan 11, 2011 10:42 am

Re: Finding the correct combination of lags for forecasting

Postby marcounam » Tue Jun 21, 2011 11:09 am

OK. I found a way to build all possible combinations of 5 series out of 22 series(i actually have 22 series of independent variables). Now the problem is that binomial coefficient (22,5) is greater 26,000, so how do i implement this for loop? do i put all the (22,5) groups in a for loop? or is there a way to do sometinhg along the lines of : "for !i=1 to (22,5)": read the subset of five variables from some database and run the regression for that subset?

Thanks for your time!
P.S I edited this post
Last edited by marcounam on Tue Jun 21, 2011 12:00 pm, edited 1 time in total.

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

Re: Finding the correct combination of lags for forecasting

Postby EViews Gareth » Tue Jun 21, 2011 11:50 am

No.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests