Page 1 of 1
Polynomial Distributed Lags with minimum AIC or SIC
Posted: Wed Oct 01, 2008 7:41 am
by grangel
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.
Posted: Wed Oct 01, 2008 8:28 am
by EViews Gareth
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)
Re: Polynomial Distributed Lags with minimum AIC or SIC
Posted: Fri Dec 09, 2011 2:24 pm
by gcg
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.
Polynomial Distributed Lags with minimum AIC or SIC
Posted: Fri Dec 09, 2011 4:52 pm
by EViews Gareth
The number of lags has to be greater than the degree of polynomial.
Re: Polynomial Distributed Lags with minimum AIC or SIC
Posted: Thu Jan 22, 2015 10:31 am
by econworker
Hi Gareth, can you tell me how can I generate Impulse Response function graphs from DPL? thanks
Re: Polynomial Distributed Lags with minimum AIC or SIC
Posted: Thu Jan 22, 2015 10:53 am
by EViews Gareth
There is nothing built in that will do that.
Re: Polynomial Distributed Lags with minimum AIC or SIC
Posted: Fri Jan 23, 2015 2:19 am
by econworker
Thanks Gareth, can you give a hint how can I generate it manually?