Page 1 of 1
Example 2.4, 2ndEdn
Posted: Sat Feb 06, 2021 5:19 am
by ac_1
Hi Tom,
In the 2ndEdn, Example 2.4 p.57, how do I get
exactly the same results as @bjautofit? I've tried adding maxl and different dates in the do loop version.
Code: Select all
boxjenk(noprint,constant,ar=p,ma=q,maxl) dly 1961:1 *
many thanks,
Amarjit
Re: Example 2.4, 2ndEdn
Posted: Sat Feb 06, 2021 11:06 am
by TomDoan
You have to override the range on the @BJAUTOFIT. The default range for MAXL estimation is 1960:2 on as you only lose the data point from differencing---the original DO LOOP version used conditional least squares, which loses four data points to differences + 3 AR lags so 1961:1 is the maximum common range.
Re: Example 2.4, 2ndEdn
Posted: Sat Feb 06, 2021 12:35 pm
by ac_1
Thanks for the reply.
I am aiming for the following results:
Code: Select all
@bjautofit(constant,pmax=3,qmax=3,crit=aic) dly 1960:2 2012:4
I've added MAXL and tried to adjust the start date (and variations) but still don't get the same results?
Code: Select all
do q=0,3
do p=0,3
boxjenk(noprint,constant,ar=p,ma=q,maxl) dly 1961:1 2012:4
com aic=-2*%logl+%nreg*2
com sbc=-2*%logl+%nreg*log(%nobs)
disp "Order("+p+","+q+")" "AIC=" aic "SBC=" sbc "OK" %converged
end do p
end do q
Re: Example 2.4, 2ndEdn
Posted: Sat Feb 06, 2021 1:52 pm
by TomDoan
The BOXJENK in the loop has a different range than the one you want.
Re: Example 2.4, 2ndEdn
Posted: Sat Feb 06, 2021 1:59 pm
by ac_1
I've tried to adjust the range and cannot get the same results.
However, if I use the formula from @BJAUTOFIT in the loop (e.g. for AIC (p+q) instead of %nreg), and the same range, I do get the same results.
Code: Select all
do q=0,3
do p=0,3
boxjenk(noprint,constant,ar=p,ma=q,maxl) dly 1960:2 2012:4
com aic=-2*%logl+((p+q)*2.0)
disp "Order("+p+","+q+")" "AIC=" aic "OK" %converged
end do p
end do q
*
Re: Example 2.4, 2ndEdn
Posted: Sat Feb 06, 2021 2:32 pm
by TomDoan
The results are the same. There are various equivalent ways to compute AIC and BIC that order models the same way, and that's all that matters.