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.
Polynomial Distributed Lags with minimum AIC or SIC
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
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.
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)
Re: Polynomial Distributed Lags with minimum AIC or SIC
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.
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
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
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
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
Thanks Gareth, can you give a hint how can I generate it manually?
Who is online
Users browsing this forum: No registered users and 1 guest
