AIC on all combinations
AIC on all combinations
Dear all,
I'm looking for a code by which RATS computes AIC on all combinations to get minimum of lags for more than two
variables. Is there any way to do it?
I'm looking for a code by which RATS computes AIC on all combinations to get minimum of lags for more than two
variables. Is there any way to do it?
Re: AIC on all combinations
Code: Select all
*
* Based upon AKAIKE.RPF example
*
open data haversample.rat
calendar(m) 1947
data(format=rats) 1947:1 2007:4 fltg ftb3
set shortrate = ftb3
set longrate = fltg
*
compute pmax=12,qmax=12
compute bestp=bestq=1
compute bestaic=%na
cmom
# longrate constant shortrate{1 to pmax} longrate{1 to qmax}
do p=1,pmax
do q=1,qmax
linreg(noprint,cmom) longrate
# constant shortrate{1 to p} longrate{1 to q}
@regcrits(noprint)
if .not.%valid(bestaic).or.%aic<bestaic
compute bestp=p,bestq=q,bestaic=%aic
end do q
end do p
disp "Minimum AIC Lags" "p=" bestp "q=" bestq
Re: AIC on all combinations
Well done, Tom.
Does it possible to use it as an option in LINREG instruction?
Does it possible to use it as an option in LINREG instruction?
Re: AIC on all combinations
No. LINREG does estimation for a fixed set of regressors. STWISE is designed for selecting the regressors using some systematic approach, but it wouldn't do multiple lag length selections---that's way too specific an application for a general purpose instruction.abi wrote:Well done, Tom.
Does it possible to use it as an option in LINREG instruction?