Polynomial Distributed Lags with minimum AIC or SIC

For questions regarding programming in the EViews programming language.

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

grangel
Posts: 3
Joined: Wed Oct 01, 2008 7:25 am

Polynomial Distributed Lags with minimum AIC or SIC

Postby grangel » Wed Oct 01, 2008 7:41 am

Hi,

I was wondering how do I write a program where I can manipulate the degree of polynomial and the lag length of a PDL variable so as to minimize the AIC or SIC for an entire equation. My model has 6 PDL independent variables. The program should also be able to identify the exact equation that minimizes the AIC or SIC.

Thanks.

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

Postby EViews Gareth » Wed Oct 01, 2008 8:28 am

Hi.

Should be fairly easy to do with a couple of for loops that loop through the combinations of lags and degrees that you want. Below is a simple program that generates some data, then loops through some combinations.

Code: Select all

'create some data create u 1000 series y=nrnd series x=nrnd 'loop through combinations of lag (1 to 10) and degree of polynomial (1 to 5), finding the equation with the min aic equation e1 !min_aic = 100000000 smpl 11 @last for !deg=1 to 5 for !lag=!deg to 10 e1.ls y c pdl(x,!lag,!deg) if e1.@aic < !min_aic then !best_lag =!lag !best_deg = !deg !min_aic = e1.@aic endif next next 'finally estimate equation with the chosen lag/degree combination e1.ls y c pdl(x,!best_lag, !best_deg)

gcg
Posts: 11
Joined: Wed Oct 29, 2008 9:18 pm

Re: Polynomial Distributed Lags with minimum AIC or SIC

Postby gcg » Fri Dec 09, 2011 2:24 pm

Hi,

Its been a long time since I looked at this code, but why does !lag start at !deg? The code says:
'loop through combinations of lag (1 to 10) and degree of polynomial (1 to 5), finding the equation with the min aic
equation e1
!min_aic = 100000000
smpl 11 @last
for !deg=1 to 5
for !lag=!deg to 10

Shouldn't !lag go from 1 to 10?

Thanks for your reply.

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

Polynomial Distributed Lags with minimum AIC or SIC

Postby EViews Gareth » Fri Dec 09, 2011 4:52 pm

The number of lags has to be greater than the degree of polynomial.

econworker
Posts: 39
Joined: Thu Apr 24, 2014 3:51 am

Re: Polynomial Distributed Lags with minimum AIC or SIC

Postby econworker » Thu Jan 22, 2015 10:31 am

Hi Gareth, can you tell me how can I generate Impulse Response function graphs from DPL? thanks

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

Re: Polynomial Distributed Lags with minimum AIC or SIC

Postby EViews Gareth » Thu Jan 22, 2015 10:53 am

There is nothing built in that will do that.

econworker
Posts: 39
Joined: Thu Apr 24, 2014 3:51 am

Re: Polynomial Distributed Lags with minimum AIC or SIC

Postby econworker » Fri Jan 23, 2015 2:19 am

Thanks Gareth, can you give a hint how can I generate it manually?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests