Example 2.4, 2ndEdn

This is the development of a 2nd Edition of Enders' RATS Programming Manual.

Moderator: TomDoan

ac_1
Posts: 467
Joined: Thu Apr 15, 2010 6:30 am

Example 2.4, 2ndEdn

Unread post 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
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: Example 2.4, 2ndEdn

Unread post 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.
ac_1
Posts: 467
Joined: Thu Apr 15, 2010 6:30 am

Re: Example 2.4, 2ndEdn

Unread post 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
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: Example 2.4, 2ndEdn

Unread post by TomDoan »

The BOXJENK in the loop has a different range than the one you want.
ac_1
Posts: 467
Joined: Thu Apr 15, 2010 6:30 am

Re: Example 2.4, 2ndEdn

Unread post 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
*
TomDoan
Posts: 7776
Joined: Wed Nov 01, 2006 4:36 pm

Re: Example 2.4, 2ndEdn

Unread post 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.
Post Reply